制作对某个人做出反应的不和谐机器人的问题

时间:2021-04-10 20:01:02

标签: python discord

正如标题所说,我正在尝试为我的服务器制作一个不和谐的机器人。我已将其设置为对包含特定单词的消息做出反应并回复其他一些消息。但我不能让它总是对特定的人做出反应。这是我的一些代码:

import discord

custom_emojis = ["Thonk","TriHard7","xontros2"]


client = discord.Client()

@client.event
async def react(message,num):
    for emoji in message.guild.emojis:
        if emoji.name == custom_emojis[num]:
            await message.add_reaction(emoji)


@client.event
async def on_message(message):
    if message.author == client.user:
        return

    if "example1" in message.content.lower():
        await message.channel.send('example1')
    if "example2" in message.content.lower():
        await react(message,0)
    if message.author.id == 'The id of the user':
        await react(message,2)



client.run('TOKEN')  

我是新手,所以任何帮助将不胜感激。

0 个答案:

没有答案