async def unmonitor(self, ctx, mention): """Admin command: unmonitor a user. Args: ctx (Context) mention (Member) Returns: None """ target_user = ctx.message.mentions[0] if not is_admin(ctx.author): if ctx.author == target_user: notifications_channel = find_channel(ctx.guild, CONFIG['NotificationsChannel']) cap(ctx, ctx.author) await ctx.send("`!unmonitor`: This is an admin-only command. {} has been capped for trying to use it.".format(ctx.author.display_name)) await notifications_channel.send('{} was capped by the `!unmonitor` command!') return if len(ctx.message.mentions) == 0: await ctx.send("`!unmonitor`: The user to be monitored must be @-mentioned as the first argument.") return if target_user in CONFIG['DATA']['monitor']: unwatch(ctx, target_user) await ctx.send('`!unmonitor`: {} has been removed from watch.'.format(target_user.display_name)) CONFIG['DATA']['monitor'].remove(target_user) save_data(CONFIG['DATAFILE']) else: await ctx.send('`!unmonitor`: {} is not on watch.'.format(target_user.display_name))
async def write(self, ctx): """Admin command: write out current state of persistent data.""" if not is_admin(ctx.author): await ctx.send('`!write`: This is an admin-only command.') else: save_data(CONFIG['DATAFILE']) await ctx.send('`!write`: Persistent store updated.')