Reputation: 239
I'm trying to make it so if a channel is deleted, it will be remade after an hour. But when I use this code:
async def on_guild_channel_delete(channel):
guild = channel.guild
await guild.create_text_channel(channel)
It returns: Object of type TextChannel is not JSON serializable
Is there anyway to fix this?
Upvotes: 0
Views: 624
Reputation: 8946
Get the channels name with str
:
await guild.create_text_channel(str(channel))
Upvotes: 1