2024-04-20 03:57:06 发布
网友
我想让我的discord机器人在每次特定用户在聊天中发送消息时都做出响应。代码会运行,但当用户发送消息时不会发生任何事情
这就是我迄今为止所尝试的:
@client.event async def on_message(message): if message.author == client.user: return if message.author.id == '546474118711869440': await message.channel.send('shhhhh')
它在一根绳子里。您必须将用户id设置为int,因此不能使用引号
if message.author.id == 546474118711869440: await message.channel.send('shhhhh')
它在一根绳子里。您必须将用户id设置为int,因此不能使用引号
相关问题 更多 >
编程相关推荐