From 6ee7c2aa36d824d93c318bbd3a1776649c598ec8 Mon Sep 17 00:00:00 2001 From: CMDR furrycat Date: Tue, 21 Feb 2017 11:56:11 +0000 Subject: [PATCH] Removed redundant highest_role() method. --- bot.py | 8 -------- plugin/faction/faction.py | 1 - 2 files changed, 9 deletions(-) diff --git a/bot.py b/bot.py index b9ec775..b666db8 100644 --- a/bot.py +++ b/bot.py @@ -479,14 +479,6 @@ def play_sound(channel, filename, *, join = True): result = yield from maybe_play_sound(channel, filename, probability = 1.0, join = join) return result -# Get the highest role a member has. -def highest_role(roles): - highest = None - for role in roles: - if highest is None or role.position > highest.position: - highest = role - return highest - def lower_role_than(member, *, strict = False): if server.me is None: log.error("Can't call lower_role_than() a member on a server we aren't on!") diff --git a/plugin/faction/faction.py b/plugin/faction/faction.py index 8b12a53..001cc6f 100644 --- a/plugin/faction/faction.py +++ b/plugin/faction/faction.py @@ -367,7 +367,6 @@ class Faction(DBConnection): if not faction.is_private: server = client.get_server(faction.server_id) announcer = server.get_member(faction.member_id) - announcer_role = bot.highest_role(announcer.roles) member = server.get_member(author.id) if member.top_role > announcer.top_role: log.debug('Member {} on server {} can edit factions from lower role.'.format(member.name, server.name)) -- 2.7.4