I wanted to make a CopyChannel(Permissions) command but something is wrong in my code:
@bot.command()
async def copych(ctx, *, channame, id: int = None):
await ctx.message.delete()
if id == None:
chan = ctx.channel
else:
chan = bot.get_channel(id=id)
chan_perm = chan.overwrites
await ctx.guild.create_text_channel(name=channame, overwrites=chan_perm)
There are no Errors and the channel is getting created but it doesn't overwrite the permissions.
I tried this here aswell but same Thing:
@bot.command()
async def copych(ctx, *, channame, id: int = None):
await ctx.message.delete()
if id == None:
chan = ctx.channel
else:
chan = bot.get_channel(id=id)
chan_perm = chan.overwrites
f = await ctx.guild.create_text_channel(name=channame)
await f.edit(overwrites=chan_perm)
Can someone tell me where the problem in the code is.
Thanks in advance
question from:
https://stackoverflow.com/questions/65937485/discord-py-copy-channel-with-permissions 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…