diff --git a/app/dragon-bot.py b/app/dragon-bot.py index ca28d18f..89a92c5f 100644 --- a/app/dragon-bot.py +++ b/app/dragon-bot.py @@ -162,7 +162,15 @@ async def on_message(message): await client.send_message(message.channel, random.choice(excuses)) if message.content.startswith('!purge'): - await client.purge_from(message.channel, limit=20, check=is_me) + num = 20 + if len(message.content.split()) > 1: + try: + num = int(message.content.split()[1]) + except ValueError: + # If they dont enter a number, show them an error and return out of the function + await client.send_message(message.channel, "You need to give me a number, you entered {}".format(message.content.split()[1])) + return + await client.purge_from(message.channel, limit=num, check=is_me) # await client.send_message(message.channel, 'Deleted {} message(s)'.format(len(deleted))) if message.content.startswith('!decide'): diff --git a/app/help_methods.py b/app/help_methods.py index b78cf92e..a01faf5d 100644 --- a/app/help_methods.py +++ b/app/help_methods.py @@ -25,8 +25,8 @@ def get_help_message(method): 'Can only be used in NSFW channels' ], 'purge': [ - 'Deletes the last 100 messages you sent from the channel you', - 'typed purge in' + 'Deletes the last 20 messages you sent from the channel you', + 'typed purge in, unless otherwise specified. eg. !purge 8' ], 'triggered': [ 'REEEEEEEEEEEEEEEEEE'],