summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Kobert <dennis@kobert.dev>2020-10-15 19:21:46 +0200
committerDennis Kobert <dennis@kobert.dev>2020-10-15 19:21:46 +0200
commit7a5778de58e371ff7f96f3dc1d2dc58854a3eb1d (patch)
treef4771abc38b2495d3b1bfdc4172dd47f921da2a0
parent47562293ebb8cabc862509c9ba1d62d982bee3c1 (diff)
Fix some linting issues
-rw-r--r--bot.py5
-rw-r--r--commands.py6
2 files changed, 6 insertions, 5 deletions
diff --git a/bot.py b/bot.py
index 7b6e925..bf27e58 100644
--- a/bot.py
+++ b/bot.py
@@ -1,4 +1,5 @@
from os import getenv
+import sys
import asyncio
from commands import answer, await_n, bot_commands
@@ -64,7 +65,7 @@ class Cupido(commands.Bot):
def get_pair_channels_no_cache(self, ctx, meta_channel):
return sorted((channel for channel in ctx.guild.voice_channels
if channel.category == meta_channel
- and channel.name.isdigit()),
+ and channel.name.isdigit()),
key=lambda c: c.name)
def get_pair_channels(self, ctx, meta_channel):
@@ -104,7 +105,7 @@ def main():
token = getenv(config.TOKEN_ENV_VAR)
if token is None:
print('error: no token was given')
- exit(1)
+ sys.exit(1)
bot = Cupido(activity=discord.Game(name=config.GAME_STATUS), command_prefix=config.COMMAND_PREFIX, case_insensitive=True)
bot.remove_command('help')
for cmd in bot_commands:
diff --git a/commands.py b/commands.py
index 916b4ad..5bef7fa 100644
--- a/commands.py
+++ b/commands.py
@@ -60,7 +60,7 @@ async def shuffle(ctx: commands.Context, channel_size=2):
if not members:
await answer(ctx, 'error: nobody wants to get shuffeled :(')
return False
- elif len(members) < channel_size:
+ if len(members) < channel_size:
await answer(ctx, f'error: you are too few people ({len(members)}). Group size is {channel_size}')
return False
# round up the quotient between the member count and the channel size
@@ -104,13 +104,13 @@ async def loop_cycle(ctx, t):
@commands.command(
help=f'repeat "shuffle" and "stop" <n> (default: {config.DEFAULT_LOOP_COUNT}) times and <t>'
-f' (default: {config.DEFAULT_LOOP_TIME}) seconds',
+ f' (default: {config.DEFAULT_LOOP_TIME}) seconds',
aliases=('repeat', 'shuffleloop'))
async def loop(ctx: commands.Context, n=config.DEFAULT_LOOP_COUNT, t=config.DEFAULT_LOOP_TIME):
try:
n, t = int(n), int(t)
except ValueError:
- await answer(ctx, f'error: expecting positive integer arguments for <n> and <t> (e.g. "loop 5 60" to repeat 5 times)')
+ await answer(ctx, 'error: expecting positive integer arguments for <n> and <t> (e.g. "loop 5 60" to repeat 5 times)')
return
await answer(ctx, f'error: repeat shuffling {n} times and each {t} seconds')
for _ in range(n):