interval += '{}s'.format(seconds)
return interval
-def shared_with(user, instance):
+def shared_with(user, instance, allow_admin_override = True):
if user is None:
return True
if user.id == client.user.id:
return True
- if is_admin(user):
+ if allow_admin_override and is_admin(user):
return True
if type(instance) == discord.server.Server:
server_id = None
ap = ThrowingArgumentParser()
+ ap.add_argument('--admin', action='store_true')
ap.add_argument('--channel', '--channels', action='store_true')
ap.add_argument('--member', '--members', action='store_true')
ap.add_argument('--role', '--roles', action='store_true')
continue
results.append(server)
- yield from bot.say_many(message.channel, ['{} {} {}{}'.format(Identify.string(result), result.id, result.name, ' {}'.format(result.joined_at) if type(result) == discord.member.Member else '') for result in set(results) if bot.shared_with(message.author, result)])
+ yield from bot.say_many(message.channel, ['{} {} {}{}'.format(Identify.string(result), result.id, result.name, ' {}'.format(result.joined_at) if type(result) == discord.member.Member else '') for result in set(results) if bot.shared_with(message.author, result, allow_admin_override = bool(parsed.admin))])