I wrote the code that works properly but I also want to get the channel deletor to perform that person operation
my code discord py :
@bot.event
async def on_guild_channel_delete(channel):
await channel.clone(name=channel.name,reason="clone channel")
how to get user channel deleted
enjoy ! thanks
It is possible, but you're gonna have to fetch the info from the audit logs
If you want the user that DELETED the newly deleted channel
@bot.event
async def on_guild_channel_delete(channel):
async for entry in channel.guild.audit_logs(limit=1, action=discord.AuditLogAction.channel_delete):
print(f"User: {entry.user} deleted channel {channel}")
# Banning the user
await channel.guild.ban(entry.user)
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments