How do you have a bot add a reaction using a custom emoji?

前端 未结 2 1526
伪装坚强ぢ
伪装坚强ぢ 2020-12-11 07:21

I\'m trying to add a custom emoji as a reaction to a message using discord.py version 0.16.12 and I\'m unable to get it functional. Here\'s the code I\'m using:



        
2条回答
  •  盖世英雄少女心
    2020-12-11 07:50

    Nevermind, folks, I figured it out. You do have to pass it the emoji object itself. For posterity's sake, here's the code I ended up using:

    async def on_message(message):
    if message.content.find(':EmojiName:'):
        for x in client.get_all_emojis():
            if x.id == '#EmojiID#':
                return await client.add_reaction(message, x)
    

提交回复
热议问题