[V3 Admin] Announce ignore parameter modification (#1781)

This commit is contained in:
Michael H 2018-06-02 18:20:01 -04:00 committed by Will
parent 2ab8890540
commit 8610b47a68

View File

@ -264,20 +264,16 @@ class Admin:
@announce.command(name="ignore") @announce.command(name="ignore")
@commands.guild_only() @commands.guild_only()
@checks.guildowner_or_permissions(administrator=True) @checks.guildowner_or_permissions(administrator=True)
async def announce_ignore(self, ctx, *, guild: discord.Guild = None): async def announce_ignore(self, ctx):
""" """
Toggles whether the announcements will ignore the given server. Toggles whether the announcements will ignore the current server.
Defaults to the current server if none is provided.
""" """
if guild is None: ignored = await self.conf.guild(ctx.guild).announce_ignore()
guild = ctx.guild await self.conf.guild(ctx.guild).announce_ignore.set(not ignored)
ignored = await self.conf.guild(guild).announce_ignore()
await self.conf.guild(guild).announce_ignore.set(not ignored)
verb = "will" if ignored else "will not" verb = "will" if ignored else "will not"
await ctx.send("The server {} {} receive announcements.".format(guild.name, verb)) await ctx.send(f"The server {ctx.guild.name} {verb} receive announcements.")
async def _valid_selfroles(self, guild: discord.Guild) -> Tuple[discord.Role]: async def _valid_selfroles(self, guild: discord.Guild) -> Tuple[discord.Role]:
""" """