【发布时间】:2021-04-09 23:18:04
【问题描述】:
我尝试了多种方法;搜索名称,使用名称本身加上 # 和数字(例如 john#5645)和用户 ID(例如 4870410505695869),但似乎没有一个工作。这是我当前的代码:
@client.event
async def on_message(message):
if message.author == client.user:
return
msg = message.content
if db["responding"]:
options = starter_encouragements
if "encouragements" in db.keys():
options = options + db["encouragements"]
if any(word in msg for word in sad_words):
await message.channel.send(random.choice(options))
@client.event
async def on_message(message):
if message.author == client.user:
if message.author.id == my id:
return
await message.channel.send(random.choice(options))
【问题讨论】:
-
不要使用虚拟文本来蔑视现有的自动过滤器。他们在那里是有原因的。
标签: python discord bots discord.py