mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 19:28:54 -05:00
Checks for administrator role
This commit is contained in:
parent
27ce0fc57a
commit
11dddc4e40
@ -12,7 +12,7 @@ class Alias:
|
|||||||
self.aliases = fileIO("data/alias/aliases.json", "load")
|
self.aliases = fileIO("data/alias/aliases.json", "load")
|
||||||
|
|
||||||
@commands.group(pass_context=True)
|
@commands.group(pass_context=True)
|
||||||
@checks.mod_or_permissions(manage_server=True)
|
@checks.mod_or_permissions(administrator=True)
|
||||||
async def alias(self, ctx):
|
async def alias(self, ctx):
|
||||||
"""Manage per-server aliases for commands"""
|
"""Manage per-server aliases for commands"""
|
||||||
if ctx.invoked_subcommand is None:
|
if ctx.invoked_subcommand is None:
|
||||||
|
|||||||
@ -13,7 +13,7 @@ class CustomCommands:
|
|||||||
self.c_commands = fileIO("data/customcom/commands.json", "load")
|
self.c_commands = fileIO("data/customcom/commands.json", "load")
|
||||||
|
|
||||||
@commands.command(pass_context=True, no_pm=True)
|
@commands.command(pass_context=True, no_pm=True)
|
||||||
@checks.mod_or_permissions(manage_server=True)
|
@checks.mod_or_permissions(administrator=True)
|
||||||
async def addcom(self, ctx, command : str, *, text):
|
async def addcom(self, ctx, command : str, *, text):
|
||||||
"""Adds a custom command
|
"""Adds a custom command
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ class CustomCommands:
|
|||||||
await self.bot.say("This command already exists. Use editcom to edit it.")
|
await self.bot.say("This command already exists. Use editcom to edit it.")
|
||||||
|
|
||||||
@commands.command(pass_context=True, no_pm=True)
|
@commands.command(pass_context=True, no_pm=True)
|
||||||
@checks.mod_or_permissions(manage_server=True)
|
@checks.mod_or_permissions(administrator=True)
|
||||||
async def editcom(self, ctx, command : str, *, text):
|
async def editcom(self, ctx, command : str, *, text):
|
||||||
"""Edits a custom command
|
"""Edits a custom command
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ class CustomCommands:
|
|||||||
await self.bot.say("There are no custom commands in this server. Use addcom [command] [text]")
|
await self.bot.say("There are no custom commands in this server. Use addcom [command] [text]")
|
||||||
|
|
||||||
@commands.command(pass_context=True, no_pm=True)
|
@commands.command(pass_context=True, no_pm=True)
|
||||||
@checks.mod_or_permissions(manage_server=True)
|
@checks.mod_or_permissions(administrator=True)
|
||||||
async def delcom(self, ctx, command : str):
|
async def delcom(self, ctx, command : str):
|
||||||
"""Deletes a custom command
|
"""Deletes a custom command
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,7 @@ class Mod:
|
|||||||
self.past_names = fileIO("data/mod/past_names.json", "load")
|
self.past_names = fileIO("data/mod/past_names.json", "load")
|
||||||
|
|
||||||
@commands.group(pass_context=True, no_pm=True)
|
@commands.group(pass_context=True, no_pm=True)
|
||||||
@checks.serverowner_or_permissions(manage_server=True)
|
@checks.serverowner_or_permissions(administrator=True)
|
||||||
async def modset(self, ctx):
|
async def modset(self, ctx):
|
||||||
"""Manages server administration settings."""
|
"""Manages server administration settings."""
|
||||||
if ctx.invoked_subcommand is None:
|
if ctx.invoked_subcommand is None:
|
||||||
@ -507,6 +507,7 @@ class Mod:
|
|||||||
await self.bot.say("Something went wrong.")
|
await self.bot.say("Something went wrong.")
|
||||||
|
|
||||||
@editrole.command(name="name", pass_context=True)
|
@editrole.command(name="name", pass_context=True)
|
||||||
|
@checks.admin_or_permissions(administrator=True)
|
||||||
async def edit_role_name(self, ctx, role: discord.Role, name: str):
|
async def edit_role_name(self, ctx, role: discord.Role, name: str):
|
||||||
"""Edits a role's name
|
"""Edits a role's name
|
||||||
|
|
||||||
|
|||||||
@ -17,7 +17,7 @@ class Trivia:
|
|||||||
self.settings = fileIO("data/trivia/settings.json", "load")
|
self.settings = fileIO("data/trivia/settings.json", "load")
|
||||||
|
|
||||||
@commands.group(pass_context=True)
|
@commands.group(pass_context=True)
|
||||||
@checks.mod_or_permissions(manage_roles=True)
|
@checks.mod_or_permissions(administrator=True)
|
||||||
async def triviaset(self, ctx):
|
async def triviaset(self, ctx):
|
||||||
"""Change trivia settings"""
|
"""Change trivia settings"""
|
||||||
if ctx.invoked_subcommand is None:
|
if ctx.invoked_subcommand is None:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user