From: CMDR furrycat Date: Mon, 6 Mar 2017 15:05:08 +0000 (+0000) Subject: Allow members with same role as bot to ASAP announcements. X-Git-Url: http://git.furryclan.net/?a=commitdiff_plain;h=0011f7a70f52973427fc6dba3acb0bfcf01603b6;p=furrycat%2Fcatbot.git Allow members with same role as bot to ASAP announcements. --- diff --git a/plugin/announcements/announcements.py b/plugin/announcements/announcements.py index baffd89..95c1018 100644 --- a/plugin/announcements/announcements.py +++ b/plugin/announcements/announcements.py @@ -149,7 +149,7 @@ class Announcements(DBConnection): log.debug('Member {} on server {} can show announcement {}.'.format(member.name, server.name, announcement.id)) return announcement - if command in ['edit', 'delete', 'schedule']: + if command in ['asap', 'edit', 'delete', 'schedule']: if announcement is not None: if announcement.member_id == author.id: log.debug('Anyone can manage own announcements.') @@ -161,7 +161,7 @@ class Announcements(DBConnection): if member.top_role > announcer.top_role: log.debug('Member {} with role {} on server {} can edit announcements from lower role.'.format(member.name, member.top_role.name, server.name)) return announcement - elif member.top_role == announcer.top_role: + elif command == 'asap' or member.top_role == announcer.top_role: if member.top_role == member.server.me.top_role: log.debug('Member {} with role {} on server {} can edit announcements.'.format(member.name, member.top_role.name, server.name)) return announcement @@ -669,7 +669,7 @@ class Announcements(DBConnection): await cat.yelp(message.channel) async def schedule_announcement(self, message, id, **args): - announcement = await self.can_manage_announcements(message.author, message.channel, 'schedule', id = id) + announcement = await self.can_manage_announcements(message.author, message.channel, 'schedule' if 'pause' in args else 'asap', id = id) if not announcement: return