From bee600fa2a94bdf0f4fc826c0914d012f28e9988 Mon Sep 17 00:00:00 2001 From: sco1 Date: Sun, 7 Oct 2018 15:26:06 -0700 Subject: Add Hacktoberfest user stats cog (#7) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Initialize Hacktoberfest stats cog * Fix generated grammar, add temporary variables to shorten string gen * Code review modifications Adjust variable & function names to be more in line with PEP8's recommendations. Break API query URL into multiple parts to aid readability and customization Adjust command input to explicitly accept a username input rather than star packing & unpacking. d.py guards against too many inputs for us Change _getURL to _get_shortname and adjust documentation because we're not even doing what the function name and documentation said we were * Remove hardcoded response channel * Update prefixes Spoooooky * Swap emoji for unicode string 👻👻👻 * Change unicode ghost string to a friendlier ghost string See: Casper, the Friendly Ghost --- bot/bot.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'bot/bot.py') diff --git a/bot/bot.py b/bot/bot.py index a67fcdab..f2a857bc 100644 --- a/bot/bot.py +++ b/bot/bot.py @@ -1,13 +1,14 @@ +from os import environ from pathlib import Path from sys import stderr from traceback import print_exc -from os import environ from discord.ext import commands - HACKTOBERBOT_TOKEN = environ.get('HACKTOBERBOT_TOKEN') -bot = commands.Bot(command_prefix=commands.when_mentioned_or('!')) + +ghost_unicode = "\N{GHOST}" +bot = commands.Bot(command_prefix=commands.when_mentioned_or(".", f"{ghost_unicode} ", ghost_unicode)) if __name__ == '__main__': # Scan for files in the /cogs/ directory and make a list of the file names. -- cgit v1.2.3