获取将表情符号添加到邮件中的列表用户

时间:2019-07-05 18:21:12

标签: python-3.x discord.py

我正试图吸引那些在邮件中放置了某些表情符号的用户。我想发送消息和在新消息中对第二个频道做出反应的用户列表。

我设置了一个事件,以在将某个表情符号添加到某个频道中的消息时触发。从某种意义上说,当添加适当的表情符号时,它会触发,但是 1)我无法弄清楚如何获取该消息以将其实际发送到新频道,并且 2)我不知道如何获得在邮件中应用了某些表情符号的用户的列表

@client.event 
async def on_reaction_add(reaction, user):
    user1 = ""
    user2 = ""
    guild = reaction.message.guild
    Channel = discord.utils.get(guild.text_channels, name='old-channel')
    if reaction.message.channel.name != 'old-channel':
        return
    if reaction.emoji.id == 572468014910537740: # the emoji to trigger on
        newchannel=  discord.utils.get(guild.text_channels, name='new-channel')
        emojis = reaction.message.reactions
        for each emoji in emojis:
            if emoji.id == 572468015074115592: # I need this for user 2
                user2 = emoji.user
            else if emoji.id == 572468014847361036:  # I need this for User 1
                user1 = emoji.user
        await newchannel.send(reaction.message.content) # fails... no content
        await reaction.message.delete()

我希望它发送消息内容,然后是user1和user2。它当前表示消息不包含任何内容,这很奇怪。可能是因为该消息本身是作为嵌入发布的,但是reaction.message.embed也表示未找到嵌入。

如何获取嵌入了表情符号的嵌入式消息,将嵌入内容+“ \ n user1:” + user1 + \ n user2:“ + user2发送给新频道?

0 个答案:

没有答案