Discord 当命令运行时,是否重新回滚赠品命令没有响应?

Discord 当命令运行时,是否重新回滚赠品命令没有响应?,discord,discord.py,Discord,Discord.py,我正试图发出一个不和谐的送礼重播命令。 问题是,当命令运行时,它没有响应/重新滚动赠品。 我用同一个命令查看了多个站点,但所有这些站点都不起作用/都有解决方案。 我还尝试不嵌入,看看这是否是代码的问题。 下面是reroll命令代码- (如果需要赠品命令代码,我可以提供) @client.command() @commands.has_权限(kick_members=True) 异步def reroll(ctx,通道:discord.TextChannel,id:int): 尝试: new\u m

我正试图发出一个不和谐的送礼重播命令。 问题是,当命令运行时,它没有响应/重新滚动赠品。 我用同一个命令查看了多个站点,但所有这些站点都不起作用/都有解决方案。 我还尝试不嵌入,看看这是否是代码的问题。 下面是reroll命令代码- (如果需要赠品命令代码,我可以提供)

@client.command()
@commands.has_权限(kick_members=True)
异步def reroll(ctx,通道:discord.TextChannel,id:int):
尝试:
new\u msg=等待通道。获取消息(id)
除:

嵌入=不协调。嵌入(title=“命令错误⛔ - GameBot”,description=f“**频道Id输入错误!***几乎所有关于代码的内容都是正确的。但是我猜您是以错误/不正常的方式请求
用户的。您可以尝试以其他方式请求用户,这似乎是错误的来源

尝试以下操作:

users=[u代表u等待新消息中的u.responses[0].users().flant(),如果u!=client.user]
赢家=随机选择(用户)
完整代码为:

@client.command()
@commands.has_权限(kick_members=True)
异步def赠品(ctx):
#赠品代码
@client.command()
@commands.has_权限(kick_members=True)
异步def reroll(ctx,通道:discord.TextChannel,id:int):
尝试:
new\u msg=等待通道。获取消息(id)
除:
嵌入=不协调。嵌入(title=“命令错误⛔ - 游戏机器人“,

description=f“**频道Id输入不正确!**您提供的代码不起作用,我检查了一下我是否编写了错误的命令,但我没有。不过感谢您的帮助!如果我有15个以上的代表,我会投票。(终端也没有给我错误)再次检查,我使用了
message
而不是
new\u msg
。我提供的代码与您提供的代码相结合,对我来说效果很好。我不知道这可能只是因为我很笨,在discord lol中写错了命令。但是感谢所有的帮助!我一定要尝试新代码。我提供的完整代码也不起作用?我得到了一个输出注意正确的缩进。我应该把代码发送给giveway命令吗?也许我需要更新其中的一些东西才能工作?
    @client.command()
    @commands.has_permissions(kick_members=True)
    async def reroll(ctx, channel : discord.TextChannel, id_ : int):
        try:
            new_msg = await channel.fetch_message(id_)
        except:
            embed = discord.Embed(title="Command Error ⛔ - GameBot", description=f"**The Id Of A Channel Was Entered Incorrectly!** Almost everything about the code is correct. However I guess you are requesting the 
users
in a wrong/not working way. You can try to request the users in another way, this seems to be the source where the error comes from.

Try out the following:

users = [u for u in await new_msg.reactions[0].users().flatten() if u != client.user]

winner = random.choice(users)