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