【发布时间】:2021-07-03 15:39:25
【问题描述】:
代码:
import discord
class MyClient(discord.Client):
async def on_ready(self):
print('Logged in as')
print(self.user.name)
print(self.user.id)
print('------')
async def on_message(self, message):
words = [] # List of words to look for
if message.author.id == self.user.id:
return
for i in words:
if i in message.content.lower():
await message.channel.send(f"Hey <@{message.author.id}>, i have noticed that in your message is a word on a list")
break
await message.add_reaction("✅")
await client.wait_for("reaction_add")
await message.delete()
client = MyClient()
client.run("TOKEN")
我如何让机器人对自己的消息添加反应,如果用户使用它删除自己的消息 我确实在寻找答案,但上帝是 discord.py 乱七八糟,我已经看到了 6 个不起作用的答案,而且他们似乎都使用了不同的模块
如果答案很容易找到,我很抱歉,但我就是找不到
【问题讨论】:
标签: python python-3.x discord.py