mirror of
https://github.com/UiO-Gaming/mustafa.git
synced 2026-11-05 13:56:48 +01:00
put guild only restriction on command groups
This commit is contained in:
1 parent
ae672ad16f
commit
cbd803768e
1 file changed
+3
-18
+3
-18
@@ -19,8 +19,8 @@ class Info(commands.Cog):
|
||||
|
||||
self.bot = bot
|
||||
|
||||
guild_group = app_commands.Group(name="guild", description="Se ting om serveren")
|
||||
user_group = app_commands.Group(name="bruker", description="Se ting om brukeren")
|
||||
guild_group = app_commands.Group(name="guild", description="Se ting om serveren", guild_only=True)
|
||||
user_group = app_commands.Group(name="bruker", description="Se ting om brukeren", guild_only=True)
|
||||
|
||||
def construct_role_string(self, roles: list[discord.Role]) -> str:
|
||||
"""
|
||||
@@ -88,7 +88,6 @@ class Info(commands.Cog):
|
||||
|
||||
return ", ".join(members)
|
||||
|
||||
@app_commands.guild_only()
|
||||
@app_commands.checks.bot_has_permissions(embed_links=True, external_emojis=True)
|
||||
@app_commands.checks.cooldown(1, 2)
|
||||
@guild_group.command(name="info", description="Hent informasjon om en server")
|
||||
@@ -245,7 +244,6 @@ class Info(commands.Cog):
|
||||
embed.add_field(name="Bilder", value=photos_string)
|
||||
await interaction.response.send_message(embed=embed)
|
||||
|
||||
@app_commands.guild_only()
|
||||
@app_commands.checks.bot_has_permissions(embed_links=True, attach_files=True)
|
||||
@app_commands.checks.cooldown(1, 2)
|
||||
@guild_group.command(name="roller", description="Se rollene på serveren")
|
||||
@@ -271,7 +269,6 @@ class Info(commands.Cog):
|
||||
embed.set_footer(text=interaction.guild.name, icon_url=interaction.guild.icon)
|
||||
await interaction.response.send_message(embed=embed)
|
||||
|
||||
@app_commands.guild_only()
|
||||
@app_commands.checks.bot_has_permissions(embed_links=True)
|
||||
@app_commands.checks.cooldown(1, 2)
|
||||
@guild_group.command(name="boosters", description="Se boostere på serveren")
|
||||
@@ -297,7 +294,6 @@ class Info(commands.Cog):
|
||||
embed.set_footer(text=interaction.guild.name, icon_url=interaction.guild.icon)
|
||||
await interaction.response.send_message(embed=embed)
|
||||
|
||||
@app_commands.guild_only()
|
||||
@app_commands.checks.bot_has_permissions(embed_links=True)
|
||||
@app_commands.checks.cooldown(1, 2)
|
||||
@guild_group.command(name="ikon", description="Hent serverens ikon")
|
||||
@@ -315,7 +311,6 @@ class Info(commands.Cog):
|
||||
embed.set_image(url=interaction.guild.icon)
|
||||
await interaction.response.send_message(embed=embed)
|
||||
|
||||
@app_commands.guild_only()
|
||||
@app_commands.checks.bot_has_permissions(embed_links=True)
|
||||
@app_commands.checks.cooldown(1, 2)
|
||||
@guild_group.command(name="splash", description="Hent serverens splash (bakgrunnsbilde på invitasjonsside)")
|
||||
@@ -337,7 +332,6 @@ class Info(commands.Cog):
|
||||
embed.set_image(url=interaction.guild.splash)
|
||||
await interaction.response.send_message(embed=embed)
|
||||
|
||||
@app_commands.guild_only()
|
||||
@app_commands.checks.bot_has_permissions(embed_links=True)
|
||||
@app_commands.checks.cooldown(1, 2)
|
||||
@guild_group.command(name="banner", description="Hen serverens banner")
|
||||
@@ -359,7 +353,6 @@ class Info(commands.Cog):
|
||||
embed.set_image(url=interaction.guild.banner)
|
||||
await interaction.response.send_message(embed=embed)
|
||||
|
||||
@app_commands.guild_only()
|
||||
@app_commands.checks.bot_has_permissions(embed_links=True)
|
||||
@app_commands.checks.cooldown(1, 2)
|
||||
@guild_group.command(name="rolle", description="Hent informasjon om en rolle på serveren")
|
||||
@@ -404,7 +397,6 @@ class Info(commands.Cog):
|
||||
embed.add_field(name=f"Brukere med rollen ({len(rolle.members)})", value=members, inline=False)
|
||||
await interaction.response.send_message(embed=embed)
|
||||
|
||||
@app_commands.guild_only()
|
||||
@app_commands.checks.bot_has_permissions(embed_links=True)
|
||||
@app_commands.checks.cooldown(1, 2)
|
||||
@guild_group.command(name="tekstkanal", description="Hent informasjon om en tekstkanal")
|
||||
@@ -437,7 +429,6 @@ class Info(commands.Cog):
|
||||
embed.add_field(name=f"Antall med tilgang ({len(kanal.members)})", value=members)
|
||||
await interaction.response.send_message(embed=embed)
|
||||
|
||||
@app_commands.guild_only()
|
||||
@app_commands.checks.bot_has_permissions(embed_links=True)
|
||||
@app_commands.checks.cooldown(1, 2)
|
||||
@guild_group.command(name="talekanal", description="Hent informasjon om en talekanal")
|
||||
@@ -463,7 +454,6 @@ class Info(commands.Cog):
|
||||
embed.add_field(name="Antall koblet til", value=len(kanal.members))
|
||||
await interaction.response.send_message(embed=embed)
|
||||
|
||||
@app_commands.guild_only()
|
||||
@app_commands.checks.bot_has_permissions(embed_links=True)
|
||||
@app_commands.checks.cooldown(1, 5)
|
||||
@guild_group.command(name="topproller", description="Viser rollene med flest brukere i kronologisk rekkefølge")
|
||||
@@ -489,7 +479,7 @@ class Info(commands.Cog):
|
||||
)
|
||||
await interaction.response.send_message(embed=embed, view=view)
|
||||
|
||||
@commands.guild_only()
|
||||
@app_commands.guild_only()
|
||||
@app_commands.checks.bot_has_permissions(embed_links=True)
|
||||
@app_commands.checks.cooldown(1, 2)
|
||||
@app_commands.command(name="emoji", description="Hent informasjon om en emoji i serveren")
|
||||
@@ -572,7 +562,6 @@ class Info(commands.Cog):
|
||||
name="eldst", description="Viser de eldste medlemmene på serveren", parent=guild_group
|
||||
)
|
||||
|
||||
@commands.guild_only()
|
||||
@app_commands.checks.bot_has_permissions(embed_links=True)
|
||||
@app_commands.checks.cooldown(1, 5)
|
||||
@guild_oldest_group.command(
|
||||
@@ -605,7 +594,6 @@ class Info(commands.Cog):
|
||||
)
|
||||
await interaction.response.send_message(embed=embed, view=view)
|
||||
|
||||
@commands.guild_only()
|
||||
@app_commands.checks.bot_has_permissions(embed_links=True)
|
||||
@app_commands.checks.cooldown(1, 5)
|
||||
@guild_oldest_group.command(
|
||||
@@ -637,7 +625,6 @@ class Info(commands.Cog):
|
||||
)
|
||||
await interaction.response.send_message(embed=embed, view=view)
|
||||
|
||||
@app_commands.guild_only()
|
||||
@app_commands.checks.bot_has_permissions(embed_links=True, external_emojis=True)
|
||||
@app_commands.checks.cooldown(1, 2)
|
||||
@user_group.command(name="info", description="Hent informasjon om en bruker")
|
||||
@@ -734,7 +721,6 @@ class Info(commands.Cog):
|
||||
|
||||
await interaction.response.send_message(embed=embed)
|
||||
|
||||
@app_commands.guild_only()
|
||||
@app_commands.checks.bot_has_permissions(embed_links=True)
|
||||
@app_commands.checks.cooldown(1, 2)
|
||||
@user_group.command(name="roller", description="Hent roller til en bruker")
|
||||
@@ -764,7 +750,6 @@ class Info(commands.Cog):
|
||||
embed.set_footer(text=bruker.name, icon_url=bruker.display_avatar)
|
||||
await interaction.response.send_message(embed=embed)
|
||||
|
||||
@app_commands.guild_only()
|
||||
@app_commands.checks.bot_has_permissions(embed_links=True)
|
||||
@app_commands.checks.cooldown(1, 2)
|
||||
@user_group.command(name="manglenderoller", description="Se hvilke roller en bruker ikke har i en guild")
|
||||
|
||||
Reference in new issue
Block a user