Changed up what permissions are required for role management
This commit is contained in:
parent
402ddb061c
commit
0e785ef9b0
3 changed files with 10 additions and 8 deletions
|
@ -128,7 +128,7 @@ class Mod:
|
|||
if "is_owner" in func.__qualname__:
|
||||
await self.bot.say("You need to own the bot to run this command")
|
||||
return
|
||||
await self.bot.say("You are required to have `manage_server` permissions to run {}".format(cmd.qualified_name))
|
||||
await self.bot.say("You are required to have `manage_server` permissions to run `{}`".format(cmd.qualified_name))
|
||||
return
|
||||
|
||||
# Perms will be an attribute if custom_perms is found no matter what, so need to check this
|
||||
|
|
|
@ -13,7 +13,7 @@ class Roles:
|
|||
self.bot = bot
|
||||
|
||||
@commands.group(aliases=['roles'], invoke_without_command=True, no_pm=True, pass_context=True)
|
||||
@checks.custom_perms(manage_server=True)
|
||||
@checks.custom_perms(send_messages=True)
|
||||
async def role(self, ctx):
|
||||
"""This command can be used to modify the roles on the server.
|
||||
Pass no subcommands and this will print the roles currently available on this server"""
|
||||
|
@ -22,7 +22,7 @@ class Roles:
|
|||
await self.bot.say("Your server's roles are: ```\n{}```".format("\n".join(server_roles)))
|
||||
|
||||
@role.command(name='remove', pass_context=True, no_pm=True)
|
||||
@checks.custom_perms(manage_server=True)
|
||||
@checks.custom_perms(manage_roles=True)
|
||||
async def remove_role(self, ctx):
|
||||
"""Use this to remove roles from a number of members"""
|
||||
# No use in running through everything if the bot cannot manage roles
|
||||
|
@ -77,7 +77,7 @@ class Roles:
|
|||
"```\n{}```".format("\n".join(role_names), "\n".join([m.display_name for m in members])))
|
||||
|
||||
@role.command(name='add', pass_context=True, no_pm=True)
|
||||
@checks.custom_perms(manage_server=True)
|
||||
@checks.custom_perms(manage_roles=True)
|
||||
async def add_role(self, ctx):
|
||||
"""Use this to add a role to multiple members.
|
||||
Provide the list of members, and I'll ask for the role
|
||||
|
@ -127,7 +127,7 @@ class Roles:
|
|||
"```\n{}```".format("\n".join(role_names), "\n".join([m.display_name for m in members])))
|
||||
|
||||
@role.command(name='delete', pass_context=True, no_pm=True)
|
||||
@checks.custom_perms(manage_server=True)
|
||||
@checks.custom_perms(manage_roles=True)
|
||||
async def delete_role(self, ctx, *, role: discord.Role = None):
|
||||
"""This command can be used to delete one of the roles from the server"""
|
||||
# No use in running through everything if the bot cannot manage roles
|
||||
|
@ -159,7 +159,7 @@ class Roles:
|
|||
await self.bot.say("I have just removed the role {} from this server".format(role.name))
|
||||
|
||||
@role.command(name='create', pass_context=True, no_pm=True)
|
||||
@checks.custom_perms(manage_server=True)
|
||||
@checks.custom_perms(manage_roles=True)
|
||||
async def create_role(self, ctx):
|
||||
"""This command can be used to create a new role for this server
|
||||
A prompt will follow asking what settings you would like for this new role
|
||||
|
|
|
@ -239,6 +239,8 @@ class TicTacToe:
|
|||
# If no one has won, and the game has not ended in a tie, print the new updated board
|
||||
# TODO: edit in place instead of printing?
|
||||
else:
|
||||
player_turn = board.challengers.get('x') if board.X_turn else board.challengers.get('o')
|
||||
fmt = str(board) + "\nIt is now your turn "
|
||||
await self.bot.say(str(board))
|
||||
|
||||
@tictactoe.command(name='start', aliases=['challenge', 'create'], pass_context=True, no_pm=True)
|
||||
|
@ -261,8 +263,8 @@ class TicTacToe:
|
|||
# Print the board too just because
|
||||
fmt += str(self.boards[ctx.message.server.id])
|
||||
# We don't need to do anything weird with assigning x_player to something, it is already a member object, just use it
|
||||
fmt += "I have decided at random, and {} is going to be x's this game. It is your turn first!".format(
|
||||
x_player.display_name)
|
||||
fmt += "I have decided at random, and {} is going to be x's this game. It is your turn first!\n"
|
||||
"Use the {}tictactoe command, and a position, to choose where you want to play".format(x_player.display_name, ctx.prefix)
|
||||
await self.bot.say(fmt)
|
||||
|
||||
@tictactoe.command(name='delete', aliases=['stop', 'remove', 'end'], pass_context=True, no_pm=True)
|
||||
|
|
Loading…
Reference in a new issue