我的票务系统中的 Discord.py 表情符号反应不起作用?

问题描述

我想制作一个带有关闭命令的票务系统。但它不起作用。我确实收到了嵌入消息,但是当我对消息做出反应时,什么也没有发生。我什至没有收到错误

这是我的代码

@bot.command(name='Close',aliases=['close'])
async def close(ctx):
    if ctx.message.channel.name.startswith('ticket'):
        msg = 'The ticket is closed. If you aren\'t done yet react to this message with ?,if you are react with ?️'
        embed = discord.Embed(title='Closed ticket',description=msg)
        message = await ctx.send(content=None,embed=embed)
        await message.add_reaction('?')
        await message.add_reaction('?️')
        await ctx.message.channel.set_permissions(ctx.author,send_messages=False,read_messages=True)
        def check(reaction,user):
            return user == ctx.message.author and str(reaction.emoji) in ['?','?️']
        reaction,user = await bot.wait_for('reaction_add',check=check)
        if reaction.emoji == '?️':
            countdown = await ctx.send('**Ticket will be closed in 10 seconds**')
            await asyncio.sleep(1)
            await countdown.edit(content='**Ticket will be closed in 9 seconds**')
            await asyncio.sleep(1)
            await countdown.edit(content='**Ticket will be closed in 8 seconds**')
            await asyncio.sleep(1)
            await countdown.edit(content='**Ticket will be closed in 7 seconds**')
            await asyncio.sleep(1)
            await countdown.edit(content='**Ticket will be closed in 6 seconds**')
            await asyncio.sleep(1)
            await countdown.edit(content='**Ticket will be closed in 5 seconds**')
            await asyncio.sleep(1)
            await countdown.edit(content='**Ticket will be closed in 4 seconds**')
            await asyncio.sleep(1)
            await countdown.edit(content='**Ticket will be closed in 3 seconds**')
            await asyncio.sleep(1)
            await countdown.edit(content='**Ticket will be closed in 2 seconds**')
            await asyncio.sleep(1)
            await countdown.edit(content='**Ticket will be closed in 1 second**')
            await asyncio.sleep(1)
            await ctx.message.channel.delete()
            await user.send('**Ticket is deleted**')
        if reaction.emoji == '?':
            await ctx.send('**Ticket reopened**')
            await ctx.message.channel.set_permissions(user,send_messages=True)
    else:
        await ctx.send('This isnt a ticket')

我已经尝试了一些我发现的选项,但它们不起作用。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...