Skip to content

Commit

Permalink
[V3 Admin] Make [p]announce consume all args into the message (#1394)
Browse files Browse the repository at this point in the history
* Fix announce (resolves #1390)

* Make other commands consume all args

Also fixes [p]announce channel
  • Loading branch information
Tobotimus authored and tekulvw committed Mar 9, 2018
1 parent f84ef48 commit 6138b78
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions redbot/cogs/admin/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ async def _removerole(self, ctx: commands.Context, member: discord.Member,
@commands.command()
@commands.guild_only()
@checks.admin_or_permissions(manage_roles=True)
async def addrole(self, ctx: commands.Context, rolename: discord.Role,
async def addrole(self, ctx: commands.Context, rolename: discord.Role, *,
user: MemberDefaultAuthor=None):
"""
Adds a role to a user. If user is left blank it defaults to the
Expand All @@ -151,7 +151,7 @@ async def addrole(self, ctx: commands.Context, rolename: discord.Role,
@commands.command()
@commands.guild_only()
@checks.admin_or_permissions(manage_roles=True)
async def removerole(self, ctx: commands.Context, rolename: discord.Role,
async def removerole(self, ctx: commands.Context, rolename: discord.Role, *,
user: MemberDefaultAuthor=None):
"""
Removes a role from a user. If user is left blank it defaults to the
Expand Down Expand Up @@ -227,7 +227,7 @@ async def edit_role_name(self, ctx: commands.Context, role: discord.Role, *, nam

@commands.group(invoke_without_command=True)
@checks.is_owner()
async def announce(self, ctx: commands.Context, message: str):
async def announce(self, ctx: commands.Context, *, message: str):
"""
Announces a message to all servers the bot is in.
"""
Expand Down Expand Up @@ -259,7 +259,7 @@ async def announce_cancel(self, ctx):
@announce.command(name="channel")
@commands.guild_only()
@checks.guildowner_or_permissions(administrator=True)
async def announce_channel(self, ctx, channel: discord.TextChannel=None):
async def announce_channel(self, ctx, *, channel: discord.TextChannel=None):
"""
Changes the channel on which the bot makes announcements.
"""
Expand All @@ -274,7 +274,7 @@ async def announce_channel(self, ctx, channel: discord.TextChannel=None):
@announce.command(name="ignore")
@commands.guild_only()
@checks.guildowner_or_permissions(administrator=True)
async def announce_ignore(self, ctx, guild: discord.Guild=None):
async def announce_ignore(self, ctx, *, guild: discord.Guild=None):
"""
Toggles whether the announcements will ignore the given server.
Defaults to the current server if none is provided.
Expand Down Expand Up @@ -310,7 +310,7 @@ async def _valid_selfroles(self, guild: discord.Guild) -> Tuple[discord.Role]:
return valid_roles

@commands.group(invoke_without_command=True)
async def selfrole(self, ctx: commands.Context, selfrole: SelfRole):
async def selfrole(self, ctx: commands.Context, *, selfrole: SelfRole):
"""
Add a role to yourself that server admins have configured as
user settable.
Expand All @@ -319,7 +319,7 @@ async def selfrole(self, ctx: commands.Context, selfrole: SelfRole):
await self._addrole(ctx, ctx.author, selfrole)

@selfrole.command(name="remove")
async def selfrole_remove(self, ctx: commands.Context, selfrole: SelfRole):
async def selfrole_remove(self, ctx: commands.Context, *, selfrole: SelfRole):
"""
Removes a selfrole from yourself.
"""
Expand All @@ -328,7 +328,7 @@ async def selfrole_remove(self, ctx: commands.Context, selfrole: SelfRole):

@selfrole.command(name="add")
@commands.has_permissions(manage_roles=True)
async def selfrole_add(self, ctx: commands.Context, role: discord.Role):
async def selfrole_add(self, ctx: commands.Context, *, role: discord.Role):
"""
Add a role to the list of available selfroles.
"""
Expand All @@ -340,7 +340,7 @@ async def selfrole_add(self, ctx: commands.Context, role: discord.Role):

@selfrole.command(name="delete")
@commands.has_permissions(manage_roles=True)
async def selfrole_delete(self, ctx: commands.Context, role: SelfRole):
async def selfrole_delete(self, ctx: commands.Context, *, role: SelfRole):
"""
Removes a role from the list of available selfroles.
"""
Expand Down

0 comments on commit 6138b78

Please sign in to comment.