Skip to content

Commit

Permalink
Add guild_only decorators
Browse files Browse the repository at this point in the history
  • Loading branch information
LightSage committed Oct 20, 2024
1 parent f68b9ac commit 94c952a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lightning/cogs/roles/cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ async def togglerole_slash(self, interaction: discord.Interaction, role: discord

# Role state
@hybrid_command(name="persistrole", aliases=['persist'], level=CommandLevel.Admin)
@app_commands.guild_only()
@hybrid_guild_permissions(manage_roles=True)
@app_commands.describe(member="The member to persist a role to", role="The role to persist")
async def persist_role(self, ctx: GuildContext, member: discord.Member, role: discord.Role):
Expand Down Expand Up @@ -398,6 +399,7 @@ async def persist_role(self, ctx: GuildContext, member: discord.Member, role: di

@hybrid_command(level=CommandLevel.Mod)
@hybrid_guild_permissions(manage_roles=True)
@app_commands.guild_only()
async def persisted(self, ctx: GuildContext):
"""
Lists all members with persisted roles
Expand All @@ -418,6 +420,7 @@ async def persisted(self, ctx: GuildContext):

@hybrid_command(aliases=['rmpersist'], level=CommandLevel.Admin)
@hybrid_guild_permissions(manage_roles=True)
@app_commands.guild_only()
@app_commands.describe(member="The member to remove a role from", role="The role to remove")
async def unpersist(self, ctx: GuildContext, member: discord.Member, role: discord.Role):
"""Removes a role that's been persisted to a member"""
Expand Down

0 comments on commit 94c952a

Please sign in to comment.