File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,4 +28,18 @@ async def lock(interaction: discord.Interaction):
2828
2929 await interaction .response .send_message (f"🔒 Este canal foi trancado por { interaction .user .mention } !" )
3030
31- # TODO: Fazer o Comando de /unlock
31+ @bot .tree .command (name = "unlock" , description = "[Caramelo Mod] Desbloqueie um canal do servidor!" )
32+ async def unlock (interaction : discord .Interaction ):
33+
34+ if not interaction .user .guild .manage_channels :
35+ await interaction .response .send_message ("Você não tem permissão de gerenciar canais!" , ephemeral = True )
36+
37+ if interaction .user .guild .manage_channels :
38+ everyone = interaction .guild .default_role
39+ channel = interaction .channel
40+
41+ overwrite = channel .overwrites_for (everyone )
42+ overwrite .send_messages = True
43+
44+ await channel .set_permissions (everyone , overwrite = overwrite )
45+ await interaction .response .send_message (f"🔓 Este canal foi desbloqueado por { interaction .user .mention } !" )
You can’t perform that action at this time.
0 commit comments