From 8d7bdb91d70146db95f673f4183033e93d51e1fa Mon Sep 17 00:00:00 2001 From: luke Date: Fri, 24 Jul 2020 14:21:45 -0700 Subject: [PATCH] updates to the updated bot and changing storage driver --- .gitlab-ci.yml | 2 +- app/dragon-bot-updated.py | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index eee6d0a2..8ce1cf64 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,7 @@ services: command: ["dockerd-entrypoint.sh"] variables: DOCKER_TLS_CERTDIR: "" - DOCKER_DRIVER: overlay + DOCKER_DRIVER: overlay2 stages: - linting diff --git a/app/dragon-bot-updated.py b/app/dragon-bot-updated.py index 4a4fc6d2..f1ddb50f 100644 --- a/app/dragon-bot-updated.py +++ b/app/dragon-bot-updated.py @@ -60,4 +60,23 @@ async def purge(ctx): return await ctx.message.channel.purge(limit=num, check=is_me) +@bot.command(name='cleanup') +async def cleanup(ctx): + def is_discord_bot(m): + return m.author == bot.user + + num = 20 + if len(ctx.message.content.split()) > 1: + try: + num = int(ctx.message.content.split()[1]) + 1 + except ValueError: + await ctx.send( + ctx.message.channel, + "You need to give me a number, you entered {}".format( + ctx.message.content.split()[1] + ) + ) + return + await ctx.message.channel.purge(limit=num, check=is_discord_bot) + bot.run(TOKEN)