@client.command(aliases=['d','dc'])
async def deletechannel(ctx,name: discord.TextChannel,amount):
for i in range (int(amount)):
channel = name
await channel.delete()
它只让我一次删除一个,即使一个有 100 个同名频道
答案 0 :(得分:0)
试试这个
先导入贪婪
from discord.ext.commands import Greedy
然后
@client.command(aliases=['d','dc'])
async def deleteChannel(ctx, name: Greedy[discord.TextChannel]):
for i in name:
await i.delete()
这里是关于贪婪的信息。 here