hello, I’m new here and actually I joined because I’ve been having problems with my discord bot that I write in python. I’m trying to make a function that deletes a channel on pre-specified server, then creates new one with the same overwrites. The problem is that bot deletes the chosen server, but doesn’t create a new one. Here is the code: (“server” is predefined)
if ((message.author.id=='myid')and(message.content.startswith('d!renew'))):
lis=list(server.channels)
chec=False
for i in range(len(lis)):
if lis[i].name==message.content[8:]:
chan=lis[i]
chec=True
break
if chec==False:
await client.send_message('I can\'t find channel',message.channel)
return
Name=chan.name
Overwrites=chan.overwrites
await client.delete_channel(chan)
await client.create_channel(server,Name,Overwrites)
I’d be very glad if I can find help on this forum