需要帮助在 discord.py 命令中创建线程

时间:2021-04-10 19:29:23

标签: python python-3.x for-loop discord discord.py

我试图让这个命令在我的不和谐机器人的线程中运行(这会使其更快),但效果不佳。这是命令代码

@Astro.command()
async def delchannels(ctx):
    if isinstance(ctx.message.channel, discord.DMChannel) or isinstance(ctx.message.channel, discord.GroupChannel):
        await ctx.message.delete
        await ctx.send("You can't use this command in DMs or GCs", delete_after=3)
    else:
        await ctx.message.delete()
        for channel in list(ctx.guild.channels):
            try:
                await channel.delete()
            except:
                return

0 个答案:

没有答案
相关问题