本文整理汇总了Python中DatabaseHandler.messageExists方法的典型用法代码示例。如果您正苦于以下问题:Python DatabaseHandler.messageExists方法的具体用法?Python DatabaseHandler.messageExists怎么用?Python DatabaseHandler.messageExists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DatabaseHandler
的用法示例。
在下文中一共展示了DatabaseHandler.messageExists方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: on_message
# 需要导入模块: import DatabaseHandler [as 别名]
# 或者: from DatabaseHandler import messageExists [as 别名]
async def on_message(message):
print('Message recieved')
#Is the message valid (i.e. it's not made by Discordoragi and I haven't seen it already). If no, try to add it to the "already seen pile" and skip to the next message. If yes, keep going.
if not (DiscordoragiSearch.isValidMessage(message)):
try:
if not (DatabaseHandler.messageExists(message.id)):
DatabaseHandler.addMessage(message.id, message.author.id, message.server.id, False)
except Exception:
traceback.print_exc()
pass
else:
await process_message(message)
示例2: isValidMessage
# 需要导入模块: import DatabaseHandler [as 别名]
# 或者: from DatabaseHandler import messageExists [as 别名]
def isValidMessage(message):
try:
if (DatabaseHandler.messageExists(message.id)):
return False
try:
if (message.author.name == USERNAME):
DatabaseHandler.addMessage(message.id, message.author.id, message.server.id, False)
return False
except:
pass
return True
except:
traceback.print_exc()
return False