Skip to content

Commit

Permalink
Clean up linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rce committed Jun 8, 2018
1 parent fd1b250 commit 5a6e1a0
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 11 deletions.
1 change: 0 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ disable=
undefined-variable,
ungrouped-imports,
unidiomatic-typecheck,
unnecessary-lambda,
unused-argument,
unused-import,
unused-variable,
Expand Down
4 changes: 2 additions & 2 deletions src/faceit_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ async def compare_toplists(client, old_toplist_dict):

async def check_and_spam_rank_changes(client, old_toplist, new_toplist, spam_channel_id):
log.info("Checking rank changes")
log.info("old toplist %s\nnew toplist %s" % (old_toplist, new_toplist))
log.info("old toplist %s\nnew toplist %s", old_toplist, new_toplist)
msg = ""
for item_at_oldlists_index, item_at_newlists_index in zip(old_toplist,
new_toplist): # Compare each item of both lists side to side
Expand All @@ -421,7 +421,7 @@ async def check_and_spam_rank_changes(client, old_toplist, new_toplist, spam_cha
msg += "**%s** fell in server ranking! old rank **#%s**, new rank **#%s**\n" % (
player_name, old_rank, new_rank)
if msg:
log.info('Attempting to spam channel %s with the following message: %s' % (spam_channel_id, msg))
log.info('Attempting to spam channel %s with the following message: %s', spam_channel_id, msg)
channel = discord.Object(id=spam_channel_id)
util.threadsafe(client, client.send_message(channel, msg))
await asyncio.sleep(.25)
Expand Down
6 changes: 3 additions & 3 deletions src/run_lemon_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ async def cmd_clear(client, message, arg):
botperms = message.channel.permissions_for(message.channel.server.me)
if not perms.administrator:
await client.send_message(message.channel, 'https://youtu.be/gvdf5n-zI14')
log.info("!CLEAR: User %s access denied" % message.author)
log.info("!CLEAR: User %s access denied", message.author)
return
if not botperms.manage_messages:
await client.send_message(message.channel, "Error: bot doesn't have permission to manage messages.")
Expand All @@ -236,7 +236,7 @@ async def cmd_clear(client, message, arg):
await client.purge_from(message.channel, limit=limit + 3)
await client.send_message(message.channel,
"%s messages succesfully deleted." % limit)
log.info("!CLEAR: %s deleted %s messages." % (message.author, limit))
log.info("!CLEAR: %s deleted %s messages.", message.author, limit)
except discord.errors.HTTPException as e:
if e.text == "You can only bulk delete messages that are under 14 days old.":
await client.send_message(message.channel, "You can only delete messages from the past 14 days - "
Expand Down Expand Up @@ -273,7 +273,7 @@ def isbot(message):
await client.purge_from(message.channel, limit=limit + 3, check=isbot)
await client.send_message(message.channel,
"%s bot messages succesfully deleted." % limit)
log.info("!CLEARBOT: %s deleted %s bot messages." % (message.author, limit))
log.info("!CLEARBOT: %s deleted %s bot messages.", message.author, limit)
except discord.errors.HTTPException as e:
if e.text == "You can only bulk delete messages that are under 14 days old.":
await client.send_message(message.channel, "You can only delete messages from the past 14 days - "
Expand Down
5 changes: 1 addition & 4 deletions src/sqlcommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -780,10 +780,7 @@ async def remove_user_from_playing_dict(guild_id, author):

async def is_playing(guild_id, name):
playing_list = playing_dict.get(guild_id, [])
if name in playing_list:
return True
else:
return False
return name in playing_list

async def cmd_randomquote(client, themessage, input):
guild_id = themessage.server.id
Expand Down
2 changes: 1 addition & 1 deletion src/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async def check_user_and_message_count(client):
total_messages = await get_message_count()
if total_messages and ((total_users != old_user_count) or (total_messages != old_message_count)) and \
((not CUSTOM_STATUS) or (CUSTOM_STATUS and CUSTOM_STATUS_DISPLAYED)):
log.info("Setting new values: %s total users, %s messages" % (total_users, total_messages))
log.info("Setting new values: %s total users, %s messages", total_users, total_messages)
await change_status(client, ('Total users: %s | Total messages: %s' % (total_users, total_messages)))
old_user_count, old_message_count = total_users, total_messages
CUSTOM_STATUS_DISPLAYED = False
Expand Down

0 comments on commit 5a6e1a0

Please sign in to comment.