【发布时间】:2021-11-20 00:13:57
【问题描述】:
我正在尝试制作一个仅对带有附件的消息做出反应的简单机器人。然后在一定时间后,如果它得到 2 个或更多的反应,它将链接到该消息并在审核频道上发送。
@client.event
async def on_message(message):
if message.channel.id == 828579458167996420:
if message.attachments or "http" in message.content:
msgID = message.id
await message.add_reaction("<:uut:828580756384120912>")
await asyncio.sleep(200)
x = int
if message.reactions.count(x) >= 3:
link = 'https://discord.com/channels/11223345678900/828579458167996420/' + str(msgID)
channel = client.get_channel(892065611876823100)
x = x - 1
await channel.send("this post " + str(link) + "is liked " + str(x) + "times." )
机器人会对我想要的消息做出反应,但它不会在审核频道中发布任何内容
我是初学者,对于乱七八糟的代码请见谅:\
【问题讨论】:
标签: discord.py message