如何使用get-Tu reaction_用户?

2024-05-13 00:35:42 发布

您现在位置:Python中文网/ 问答频道 /正文

if message.content.startswith('!stopafk'):
        await client.send_message(botspam,"y")
        LHss = discord.Reaction("LH:461777566408376321")
        users = await client.get_reaction_users(LHss,limit=100)

我有这个代码,我不知道如何让它工作,我尝试了一切,但我发现没有任何工作或帮助 我知道我可能只是很蠢,但它说"LH....“是2个参数,但事实并非如此。 我已经用<Emote:ID><:Emote:ID><:Emote:#ID#><Emote#ID#>代替了所有的表情,我不知道我该做什么。在


Tags: clientsendidmessageifcontentawaitusers
1条回答
网友
1楼 · 发布于 2024-05-13 00:35:42

这花了我很长时间才发现的。 下面是我在代码中使用的示例:)

@client.command(pass_context = True)
async def test(ctx):

    msg = await client.say('TEST')
    await client.add_reaction(msg, "✅")
    await asyncio.sleep(5)

    cache_msg = discord.utils.get(client.messages, id = msg.id)
    for reactor in cache_msg.reactions:
        reactors = await client.get_reaction_users(reactor)

        #from here you can do whatever you need with the member objects
        for member in reactors:
            await client.say(member.name)

相关问题 更多 >