add missing command checks + consistent order of checks

This commit is contained in:
LBlend committed 2022-11-17 18:20:53 +01:00
1 parent a987ff6d3f
commit f11238a150
5 files changed
+24 -18

No files matched your search

+4
View File
@@ -110,6 +110,7 @@ class Birthday(commands.Cog):
await channel.send(f"Gratulrer med dagen {user.mention}!")
'''
@app_commands.checks.bot_has_permissions(embed_links=True)
@app_commands.checks.cooldown(1, 5)
@app_commands.command()
async def settbursdag(self, interaction: discord.Interaction, dag: int, måned: int, år: int):
@@ -139,6 +140,7 @@ class Birthday(commands.Cog):
embed = embed_templates.success(interaction, text=f"Bursdag satt til {discord.utils.format_dt(date, style='D')}")
await interaction.response.send_message(embed=embed)
@app_commands.checks.bot_has_permissions(embed_links=True)
@app_commands.checks.cooldown(1, 5)
@app_commands.command()
async def fjernbursdag(self, interaction: discord.Interaction):
@@ -149,6 +151,7 @@ class Birthday(commands.Cog):
embed = embed_templates.success(interaction, text="Bursdag fjernet")
await interaction.response.send_message(embed=embed)
@app_commands.checks.bot_has_permissions(embed_links=True)
@app_commands.checks.cooldown(1, 5)
@app_commands.command()
async def bursdag(self, interaction: discord.Interaction, bruker: discord.Member | discord.User | None = None):
@@ -182,6 +185,7 @@ class Birthday(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, 5)
@app_commands.command()
async def kommendebursdager(self, interaction: discord.Interaction):
+5 -5
View File
@@ -12,8 +12,8 @@ class DevTools(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.bot_has_permissions(embed_links=True)
@commands.is_owner()
@commands.bot_has_permissions(embed_links=True)
@commands.command()
async def custommsg(self, ctx: commands.Context, channel: int, *text: tuple[str]):
"""Send a message to a specified channel"""
@@ -27,8 +27,8 @@ class DevTools(commands.Cog):
embed.add_field(name='Sent', value=custommessage)
await ctx.send(embed=embed)
@commands.bot_has_permissions(embed_links=True)
@commands.is_owner()
@commands.bot_has_permissions(embed_links=True)
@commands.cooldown(1, 10, commands.BucketType.guild)
@commands.command()
async def changepresence(self, ctx: commands.Context, activity_type: str, message: str, status_type: str):
@@ -55,8 +55,8 @@ class DevTools(commands.Cog):
embed = discord.Embed(color=ctx.me.color, description='Endret Presence!')
await ctx.send(embed=embed)
@commands.bot_has_permissions(embed_links=True, add_reactions=True)
@commands.is_owner()
@commands.bot_has_permissions(embed_links=True, add_reactions=True)
@commands.command()
async def leave(self, ctx: commands.Context, *guild_id: int):
"""Leaves a specified guild"""
@@ -91,8 +91,8 @@ class DevTools(commands.Cog):
except discord.errors.Forbidden:
pass
@commands.bot_has_permissions(embed_links=True)
@commands.is_owner()
@commands.bot_has_permissions(embed_links=True)
@commands.command()
async def publicip(self, ctx: commands.Context):
"""Sends WAN IP-address. inb4 I leak my IP-address"""
@@ -105,8 +105,8 @@ class DevTools(commands.Cog):
embed.add_field(name='WAN IP-address', value=f'{ip}\n{location}\n{isp}')
await ctx.send(embed=embed)
@commands.bot_has_permissions(embed_links=True)
@commands.is_owner()
@commands.bot_has_permissions(embed_links=True)
@commands.group()
async def cogs(self, ctx: commands.Context):
"""Cog management commands"""
+13 -13
View File
@@ -61,8 +61,8 @@ class Info(commands.Cog):
with misc_utils.ignore_exception(OSError):
remove(file_path)
@app_commands.checks.bot_has_permissions(embed_links=True, external_emojis=True)
@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")
async def guild_info(self, interaction: discord.Interaction):
@@ -192,8 +192,8 @@ class Info(commands.Cog):
embed.add_field(name='Bilder', value=photos_string)
await interaction.response.send_message(embed=embed)
@app_commands.checks.bot_has_permissions(embed_links=True)
@app_commands.guild_only()
@app_commands.checks.bot_has_permissions(embed_links=True)
@app_commands.checks.cooldown(1, 2)
@guild_group.command(name="roller", description="Se rollene på serveren")
async def guild_roles(self, interaction: discord.Interaction):
@@ -208,8 +208,8 @@ 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.checks.bot_has_permissions(embed_links=True)
@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")
async def guild_boosters(self, interaction: discord.Interaction):
@@ -224,8 +224,8 @@ 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.checks.bot_has_permissions(embed_links=True)
@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")
async def guild_icon(self, interaction: discord.Interaction):
@@ -235,8 +235,8 @@ class Info(commands.Cog):
embed_templates.default_footer(interaction, embed)
await interaction.response.send_message(embed=embed)
@app_commands.checks.bot_has_permissions(embed_links=True)
@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)")
async def guild_splash(self, interaction: discord.Interaction):
@@ -250,8 +250,8 @@ class Info(commands.Cog):
embed_templates.default_footer(interaction, embed)
await interaction.response.send_message(embed=embed)
@app_commands.checks.bot_has_permissions(embed_links=True)
@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")
async def guild_banner(self, interaction: discord.Interaction):
@@ -265,8 +265,8 @@ class Info(commands.Cog):
embed_templates.default_footer(interaction, embed)
await interaction.response.send_message(embed=embed)
@app_commands.checks.bot_has_permissions(embed_links=True)
@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")
async def guild_role(self, interaction: discord.Interaction, rolle: discord.Role):
@@ -299,8 +299,8 @@ class Info(commands.Cog):
embed_templates.default_footer(interaction, embed)
await interaction.response.send_message(embed=embed)
@app_commands.checks.bot_has_permissions(embed_links=True)
@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")
async def guild_text_channel(self, interaction: discord.Interaction, kanal: discord.TextChannel):
@@ -320,8 +320,8 @@ class Info(commands.Cog):
embed_templates.default_footer(interaction, embed)
await interaction.response.send_message(embed=embed)
@app_commands.checks.bot_has_permissions(embed_links=True)
@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")
async def guild_voice_channel(self, interaction: discord.Interaction, kanal: discord.VoiceChannel):
@@ -367,8 +367,8 @@ class Info(commands.Cog):
embed.set_footer(text=f'Side {paginator.current_page}/{paginator.total_page_count}')
return embed
@app_commands.checks.bot_has_permissions(embed_links=True)
@commands.guild_only()
@app_commands.checks.bot_has_permissions(embed_links=True)
@app_commands.checks.cooldown(1, 5)
@guild_oldest_group.command(name="lagd", description="Liste over de eldste brukerene på serveren basert på når de ble lagd")
async def guild_user_created_oldest(self, interaction: discord.Interaction):
@@ -389,8 +389,8 @@ class Info(commands.Cog):
embed = self.__construct_oldest_embed(paginator, paginator.get_current_page(), embed)
await interaction.response.send_message(embed=embed, view=view)
@app_commands.checks.bot_has_permissions(embed_links=True)
@commands.guild_only()
@app_commands.checks.bot_has_permissions(embed_links=True)
@app_commands.checks.cooldown(1, 5)
@guild_oldest_group.command(name="joined", description="Liste over de eldste brukerene på serveren basert på når de ble med")
async def guild_user_joined_oldest(self, interaction: discord.Interaction):
@@ -411,8 +411,8 @@ class Info(commands.Cog):
embed = self.__construct_oldest_embed(paginator, paginator.get_current_page(), embed)
await interaction.response.send_message(embed=embed, view=view)
@app_commands.checks.bot_has_permissions(embed_links=True, external_emojis=True)
@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")
async def user_info(self, interaction: discord.Interaction, *, bruker: discord.Member | None = None):
@@ -486,8 +486,8 @@ class Info(commands.Cog):
await interaction.response.send_message(embed=embed)
@app_commands.checks.bot_has_permissions(embed_links=True)
@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")
async def user_roles(self, interaction: discord.Interaction, bruker: discord.Member | None = None):
+1
View File
@@ -25,6 +25,7 @@ class MCWhitelist(commands.Cog):
)
self.bot.db_connection.commit()
@app_commands.checks.bot_has_permissions(embed_links=True)
@app_commands.checks.cooldown(1, 5)
@app_commands.command()
async def whitelist(self, interaction: discord.Interaction, minecraftbrukernavn: str):
+1
View File
@@ -94,6 +94,7 @@ https://cdn.discordapp.com/attachments/674726496878723082/1042631569396990004/kw
embed_templates.default_footer(interation, embed)
await interation.response.send_message(embed=embed)
@app_commands.checks.bot_has_permissions(embed_links=True)
@app_commands.checks.cooldown(1, 5)
@app_commands.command()
async def imdb(self, interaction: discord.Interaction, tittel: str):