From 0de62cc2ba50b2cef6e998cc797aaba1685d50b1 Mon Sep 17 00:00:00 2001 From: sco1 Date: Mon, 10 Dec 2018 16:46:06 -0500 Subject: Refactor aoc join to DM user with join code --- bot/seasons/christmas/adventofcode.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'bot/seasons/christmas/adventofcode.py') diff --git a/bot/seasons/christmas/adventofcode.py b/bot/seasons/christmas/adventofcode.py index 458eb19f..b61e77c0 100644 --- a/bot/seasons/christmas/adventofcode.py +++ b/bot/seasons/christmas/adventofcode.py @@ -19,6 +19,7 @@ log = logging.getLogger(__name__) AOC_REQUEST_HEADER = {"user-agent": "PythonDiscord AoC Event Bot"} AOC_SESSION_COOKIE = {"session": Tokens.aoc_session_cookie} +AOC_JOIN_CODE = AocConfig.leaderboard_join_code # Constant so staff can update without redeploying EST = timezone("EST") COUNTDOWN_STEP = 60 * 5 @@ -196,14 +197,23 @@ class AdventOfCode: @adventofcode_group.command(name="join", aliases=("j",), brief="Learn how to join PyDis' private AoC leaderboard") async def join_leaderboard(self, ctx: commands.Context): """ - Retrieve the link to join the PyDis AoC private leaderboard + DM the user the information for joining the PyDis AoC private leaderboard """ + author = ctx.message.author + log.info(f"{author.name} ({author.id}) has requested the PyDis AoC leaderboard code") + info_str = ( "Head over to https://adventofcode.com/leaderboard/private " - f"with code `{AocConfig.leaderboard_join_code}` to join the PyDis private leaderboard!" + f"with code `{AOC_JOIN_CODE}` to join the PyDis private leaderboard!" ) - await ctx.send(info_str) + try: + await author.send(info_str) + except discord.errors.Forbidden: + log.debug(f"{author.name} ({author.id}) has disabled DMs from server members") + await ctx.send( + f':x: {author.mention}, please (temporarily) enable DMs to receive the join code' + ) @adventofcode_group.command( name="leaderboard", -- cgit v1.2.3 From acde36e17e0a3365f5db7357d76b5a9c8ddc0ff2 Mon Sep 17 00:00:00 2001 From: sco1 Date: Mon, 10 Dec 2018 17:30:01 -0500 Subject: Add staff command to change AoC leaderboard join code --- bot/seasons/christmas/adventofcode.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'bot/seasons/christmas/adventofcode.py') diff --git a/bot/seasons/christmas/adventofcode.py b/bot/seasons/christmas/adventofcode.py index b61e77c0..0d4fd966 100644 --- a/bot/seasons/christmas/adventofcode.py +++ b/bot/seasons/christmas/adventofcode.py @@ -13,7 +13,8 @@ from bs4 import BeautifulSoup from discord.ext import commands from pytz import timezone -from bot.constants import AdventOfCode as AocConfig, Colours, Emojis, Tokens +from bot.constants import AdventOfCode as AocConfig, Colours, Emojis, Roles, Tokens +from bot.decorators import with_role log = logging.getLogger(__name__) @@ -215,6 +216,20 @@ class AdventOfCode: f':x: {author.mention}, please (temporarily) enable DMs to receive the join code' ) + @with_role(Roles.admin, Roles.owner) + @adventofcode_group.command(name="changecode", hidden=True) + async def update_aoc_join_code(self, ctx: commands.Context, new_code: str): + """ + Staff command to update the AoC join code constant locally to allow for the code to be updated + on regeneration without having to redeploy the bot + """ + + author = ctx.message.author + log.info(f"{author.name} ({author.id}) has changed the PyDis AoC leaderboard code") + + global AOC_JOIN_CODE # Necessary (probably?) evil to update the code without redeploying + AOC_JOIN_CODE = new_code + @adventofcode_group.command( name="leaderboard", aliases=("board", "lb"), -- cgit v1.2.3 From ebe67c3b469a52a1f4b4bcb2a6c2f231c30cfdd1 Mon Sep 17 00:00:00 2001 From: sco1 Date: Mon, 10 Dec 2018 17:34:38 -0500 Subject: Remove extraneous whitespace --- bot/seasons/christmas/adventofcode.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bot/seasons/christmas/adventofcode.py') diff --git a/bot/seasons/christmas/adventofcode.py b/bot/seasons/christmas/adventofcode.py index 0d4fd966..056c36ab 100644 --- a/bot/seasons/christmas/adventofcode.py +++ b/bot/seasons/christmas/adventofcode.py @@ -223,7 +223,7 @@ class AdventOfCode: Staff command to update the AoC join code constant locally to allow for the code to be updated on regeneration without having to redeploy the bot """ - + author = ctx.message.author log.info(f"{author.name} ({author.id}) has changed the PyDis AoC leaderboard code") -- cgit v1.2.3 From 191d8abceabff5b442cf1e0ce0aa5fe238520341 Mon Sep 17 00:00:00 2001 From: sco1 Date: Wed, 26 Dec 2018 10:00:08 -0500 Subject: Remove local env var modification command --- bot/seasons/christmas/adventofcode.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'bot/seasons/christmas/adventofcode.py') diff --git a/bot/seasons/christmas/adventofcode.py b/bot/seasons/christmas/adventofcode.py index 056c36ab..113f959d 100644 --- a/bot/seasons/christmas/adventofcode.py +++ b/bot/seasons/christmas/adventofcode.py @@ -20,7 +20,6 @@ log = logging.getLogger(__name__) AOC_REQUEST_HEADER = {"user-agent": "PythonDiscord AoC Event Bot"} AOC_SESSION_COOKIE = {"session": Tokens.aoc_session_cookie} -AOC_JOIN_CODE = AocConfig.leaderboard_join_code # Constant so staff can update without redeploying EST = timezone("EST") COUNTDOWN_STEP = 60 * 5 @@ -206,7 +205,7 @@ class AdventOfCode: info_str = ( "Head over to https://adventofcode.com/leaderboard/private " - f"with code `{AOC_JOIN_CODE}` to join the PyDis private leaderboard!" + f"with code `{AocConfig.leaderboard_join_code}` to join the PyDis private leaderboard!" ) try: await author.send(info_str) @@ -216,20 +215,6 @@ class AdventOfCode: f':x: {author.mention}, please (temporarily) enable DMs to receive the join code' ) - @with_role(Roles.admin, Roles.owner) - @adventofcode_group.command(name="changecode", hidden=True) - async def update_aoc_join_code(self, ctx: commands.Context, new_code: str): - """ - Staff command to update the AoC join code constant locally to allow for the code to be updated - on regeneration without having to redeploy the bot - """ - - author = ctx.message.author - log.info(f"{author.name} ({author.id}) has changed the PyDis AoC leaderboard code") - - global AOC_JOIN_CODE # Necessary (probably?) evil to update the code without redeploying - AOC_JOIN_CODE = new_code - @adventofcode_group.command( name="leaderboard", aliases=("board", "lb"), -- cgit v1.2.3 From 01470fc31cd429164a7c314f01fb5b3c81f600d2 Mon Sep 17 00:00:00 2001 From: sco1 Date: Wed, 26 Dec 2018 10:01:30 -0500 Subject: Remove unused imports --- bot/seasons/christmas/adventofcode.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'bot/seasons/christmas/adventofcode.py') diff --git a/bot/seasons/christmas/adventofcode.py b/bot/seasons/christmas/adventofcode.py index 113f959d..e9853222 100644 --- a/bot/seasons/christmas/adventofcode.py +++ b/bot/seasons/christmas/adventofcode.py @@ -13,8 +13,7 @@ from bs4 import BeautifulSoup from discord.ext import commands from pytz import timezone -from bot.constants import AdventOfCode as AocConfig, Colours, Emojis, Roles, Tokens -from bot.decorators import with_role +from bot.constants import AdventOfCode as AocConfig, Colours, Emojis, Tokens log = logging.getLogger(__name__) -- cgit v1.2.3 From 00dbe8b2cb64991102be0e242d3e54175d207814 Mon Sep 17 00:00:00 2001 From: sco1 Date: Sat, 5 Jan 2019 14:09:12 -0500 Subject: Review-directed reformatting --- bot/seasons/christmas/adventofcode.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'bot/seasons/christmas/adventofcode.py') diff --git a/bot/seasons/christmas/adventofcode.py b/bot/seasons/christmas/adventofcode.py index e9853222..f0e4f0da 100644 --- a/bot/seasons/christmas/adventofcode.py +++ b/bot/seasons/christmas/adventofcode.py @@ -210,9 +210,7 @@ class AdventOfCode: await author.send(info_str) except discord.errors.Forbidden: log.debug(f"{author.name} ({author.id}) has disabled DMs from server members") - await ctx.send( - f':x: {author.mention}, please (temporarily) enable DMs to receive the join code' - ) + await ctx.send(f":x: {author.mention}, please (temporarily) enable DMs to receive the join code") @adventofcode_group.command( name="leaderboard", -- cgit v1.2.3 From b53d8d8b7fe7c33c6931fa9075c30c27ea9c02da Mon Sep 17 00:00:00 2001 From: sco1 Date: Sun, 3 Mar 2019 21:50:01 -0500 Subject: Add new Cog class inheritance & event listener decoration Mitigates recent breaking d.py changes --- bot/bot.py | 3 ++- bot/seasons/christmas/adventofcode.py | 2 +- bot/seasons/evergreen/error_handler.py | 3 ++- bot/seasons/evergreen/fun.py | 2 +- bot/seasons/evergreen/uptime.py | 2 +- bot/seasons/halloween/candy_collection.py | 4 +++- bot/seasons/halloween/hacktoberstats.py | 2 +- bot/seasons/halloween/halloween_facts.py | 3 ++- bot/seasons/halloween/halloweenify.py | 2 +- bot/seasons/halloween/monstersurvey.py | 4 ++-- bot/seasons/halloween/scarymovie.py | 2 +- bot/seasons/halloween/spookyavatar.py | 2 +- bot/seasons/halloween/spookygif.py | 2 +- bot/seasons/halloween/spookyreact.py | 4 +++- bot/seasons/halloween/spookysound.py | 2 +- bot/seasons/valentines/be_my_valentine.py | 2 +- bot/seasons/valentines/lovecalculator.py | 4 ++-- bot/seasons/valentines/movie_generator.py | 2 +- bot/seasons/valentines/savethedate.py | 2 +- bot/seasons/valentines/valentine_zodiac.py | 2 +- bot/seasons/valentines/whoisvalentine.py | 2 +- 21 files changed, 30 insertions(+), 23 deletions(-) (limited to 'bot/seasons/christmas/adventofcode.py') diff --git a/bot/bot.py b/bot/bot.py index 12291a5f..84bac598 100644 --- a/bot/bot.py +++ b/bot/bot.py @@ -6,7 +6,7 @@ from typing import List from aiohttp import AsyncResolver, ClientSession, TCPConnector from discord import Embed from discord.ext import commands -from discord.ext.commands import Bot +from discord.ext.commands import Bot, Cog from bot import constants @@ -63,6 +63,7 @@ class SeasonalBot(Bot): await devlog.send(embed=embed) + @Cog.listener() async def on_command_error(self, context, exception): # Don't punish the user for getting the arguments wrong if isinstance(exception, commands.UserInputError): diff --git a/bot/seasons/christmas/adventofcode.py b/bot/seasons/christmas/adventofcode.py index 3b199a4a..d360ae5e 100644 --- a/bot/seasons/christmas/adventofcode.py +++ b/bot/seasons/christmas/adventofcode.py @@ -108,7 +108,7 @@ async def day_countdown(bot: commands.Bot): await asyncio.sleep(120) -class AdventOfCode: +class AdventOfCode(commands.Cog): """ Advent of Code festivities! Ho Ho Ho! """ diff --git a/bot/seasons/evergreen/error_handler.py b/bot/seasons/evergreen/error_handler.py index 47e18a31..d764fe86 100644 --- a/bot/seasons/evergreen/error_handler.py +++ b/bot/seasons/evergreen/error_handler.py @@ -8,12 +8,13 @@ from discord.ext import commands log = logging.getLogger(__name__) -class CommandErrorHandler: +class CommandErrorHandler(commands.Cog): """A error handler for the PythonDiscord server!""" def __init__(self, bot): self.bot = bot + @commands.Cog.listener() async def on_command_error(self, ctx, error): """Activates when a command opens an error""" diff --git a/bot/seasons/evergreen/fun.py b/bot/seasons/evergreen/fun.py index 4da01dd1..0003714d 100644 --- a/bot/seasons/evergreen/fun.py +++ b/bot/seasons/evergreen/fun.py @@ -8,7 +8,7 @@ from bot.constants import Emojis log = logging.getLogger(__name__) -class Fun: +class Fun(commands.Cog): """ A collection of general commands for fun. """ diff --git a/bot/seasons/evergreen/uptime.py b/bot/seasons/evergreen/uptime.py index 1321da19..cce5ae76 100644 --- a/bot/seasons/evergreen/uptime.py +++ b/bot/seasons/evergreen/uptime.py @@ -9,7 +9,7 @@ from bot import start_time log = logging.getLogger(__name__) -class Uptime: +class Uptime(commands.Cog): """ A cog for posting the bots uptime. """ diff --git a/bot/seasons/halloween/candy_collection.py b/bot/seasons/halloween/candy_collection.py index 80f30a1b..d75e0d94 100644 --- a/bot/seasons/halloween/candy_collection.py +++ b/bot/seasons/halloween/candy_collection.py @@ -20,7 +20,7 @@ ADD_SKULL_REACTION_CHANCE = 50 # 2% ADD_SKULL_EXISTING_REACTION_CHANCE = 20 # 5% -class CandyCollection: +class CandyCollection(commands.Cog): def __init__(self, bot): self.bot = bot with open(json_location) as candy: @@ -31,6 +31,7 @@ class CandyCollection: userid = userinfo['userid'] self.get_candyinfo[userid] = userinfo + @commands.Cog.listener() async def on_message(self, message): """ Randomly adds candy or skull to certain messages @@ -54,6 +55,7 @@ class CandyCollection: self.msg_reacted.append(d) return await message.add_reaction('\N{CANDY}') + @commands.Cog.listener() async def on_reaction_add(self, reaction, user): """ Add/remove candies from a person if the reaction satisfies criteria diff --git a/bot/seasons/halloween/hacktoberstats.py b/bot/seasons/halloween/hacktoberstats.py index 41cf10ee..8ac448b8 100644 --- a/bot/seasons/halloween/hacktoberstats.py +++ b/bot/seasons/halloween/hacktoberstats.py @@ -13,7 +13,7 @@ from discord.ext import commands log = logging.getLogger(__name__) -class HacktoberStats: +class HacktoberStats(commands.Cog): def __init__(self, bot): self.bot = bot self.link_json = Path("bot", "resources", "github_links.json") diff --git a/bot/seasons/halloween/halloween_facts.py b/bot/seasons/halloween/halloween_facts.py index 098ee432..64f00ab3 100644 --- a/bot/seasons/halloween/halloween_facts.py +++ b/bot/seasons/halloween/halloween_facts.py @@ -25,7 +25,7 @@ PUMPKIN_ORANGE = discord.Color(0xFF7518) INTERVAL = timedelta(hours=6).total_seconds() -class HalloweenFacts: +class HalloweenFacts(commands.Cog): def __init__(self, bot): self.bot = bot @@ -35,6 +35,7 @@ class HalloweenFacts: self.facts = list(enumerate(self.halloween_facts)) random.shuffle(self.facts) + @commands.Cog.listener() async def on_ready(self): self.channel = self.bot.get_channel(Hacktoberfest.channel_id) self.bot.loop.create_task(self._fact_publisher_task()) diff --git a/bot/seasons/halloween/halloweenify.py b/bot/seasons/halloween/halloweenify.py index cda07472..9e1bae59 100644 --- a/bot/seasons/halloween/halloweenify.py +++ b/bot/seasons/halloween/halloweenify.py @@ -10,7 +10,7 @@ from discord.ext.commands.cooldowns import BucketType log = logging.getLogger(__name__) -class Halloweenify: +class Halloweenify(commands.Cog): """ A cog to change a invokers nickname to a spooky one! """ diff --git a/bot/seasons/halloween/monstersurvey.py b/bot/seasons/halloween/monstersurvey.py index 08873f24..aa5d97d2 100644 --- a/bot/seasons/halloween/monstersurvey.py +++ b/bot/seasons/halloween/monstersurvey.py @@ -4,7 +4,7 @@ import os from discord import Embed from discord.ext import commands -from discord.ext.commands import Bot, Context +from discord.ext.commands import Bot, Cog, Context log = logging.getLogger(__name__) @@ -14,7 +14,7 @@ EMOJIS = { } -class MonsterSurvey: +class MonsterSurvey(Cog): """ Vote for your favorite monster! This command allows users to vote for their favorite listed monster. diff --git a/bot/seasons/halloween/scarymovie.py b/bot/seasons/halloween/scarymovie.py index b280781e..c9a62edf 100644 --- a/bot/seasons/halloween/scarymovie.py +++ b/bot/seasons/halloween/scarymovie.py @@ -13,7 +13,7 @@ TMDB_API_KEY = environ.get('TMDB_API_KEY') TMDB_TOKEN = environ.get('TMDB_TOKEN') -class ScaryMovie: +class ScaryMovie(commands.Cog): """ Selects a random scary movie and embeds info into discord chat """ diff --git a/bot/seasons/halloween/spookyavatar.py b/bot/seasons/halloween/spookyavatar.py index b37a03f9..a2ed3b85 100644 --- a/bot/seasons/halloween/spookyavatar.py +++ b/bot/seasons/halloween/spookyavatar.py @@ -12,7 +12,7 @@ from bot.utils.halloween import spookifications log = logging.getLogger(__name__) -class SpookyAvatar: +class SpookyAvatar(commands.Cog): """ A cog that spookifies an avatar. diff --git a/bot/seasons/halloween/spookygif.py b/bot/seasons/halloween/spookygif.py index 1233773b..f013f415 100644 --- a/bot/seasons/halloween/spookygif.py +++ b/bot/seasons/halloween/spookygif.py @@ -9,7 +9,7 @@ from bot.constants import Tokens log = logging.getLogger(__name__) -class SpookyGif: +class SpookyGif(commands.Cog): """ A cog to fetch a random spooky gif from the web! """ diff --git a/bot/seasons/halloween/spookyreact.py b/bot/seasons/halloween/spookyreact.py index f63cd7e5..92afe798 100644 --- a/bot/seasons/halloween/spookyreact.py +++ b/bot/seasons/halloween/spookyreact.py @@ -2,6 +2,7 @@ import logging import re import discord +from discord.ext.commands import Cog log = logging.getLogger(__name__) @@ -16,7 +17,7 @@ SPOOKY_TRIGGERS = { } -class SpookyReact: +class SpookyReact(Cog): """ A cog that makes the bot react to message triggers. @@ -25,6 +26,7 @@ class SpookyReact: def __init__(self, bot): self.bot = bot + @Cog.listener() async def on_message(self, ctx: discord.Message): """ A command to send the seasonalbot github project diff --git a/bot/seasons/halloween/spookysound.py b/bot/seasons/halloween/spookysound.py index 4cab1239..1fbbfea6 100644 --- a/bot/seasons/halloween/spookysound.py +++ b/bot/seasons/halloween/spookysound.py @@ -10,7 +10,7 @@ from bot.constants import Hacktoberfest log = logging.getLogger(__name__) -class SpookySound: +class SpookySound(commands.Cog): """ A cog that plays a spooky sound in a voice channel on command. """ diff --git a/bot/seasons/valentines/be_my_valentine.py b/bot/seasons/valentines/be_my_valentine.py index 0046ceb4..f589dbeb 100644 --- a/bot/seasons/valentines/be_my_valentine.py +++ b/bot/seasons/valentines/be_my_valentine.py @@ -15,7 +15,7 @@ log = logging.getLogger(__name__) HEART_EMOJIS = [":heart:", ":gift_heart:", ":revolving_hearts:", ":sparkling_heart:", ":two_hearts:"] -class BeMyValentine: +class BeMyValentine(commands.Cog): """ A cog that sends valentines to other users ! """ diff --git a/bot/seasons/valentines/lovecalculator.py b/bot/seasons/valentines/lovecalculator.py index 4df33b93..655430f5 100644 --- a/bot/seasons/valentines/lovecalculator.py +++ b/bot/seasons/valentines/lovecalculator.py @@ -9,7 +9,7 @@ from typing import Union import discord from discord import Member from discord.ext import commands -from discord.ext.commands import BadArgument, clean_content +from discord.ext.commands import BadArgument, Cog, clean_content from bot.constants import Roles @@ -20,7 +20,7 @@ with Path('bot', 'resources', 'valentines', 'love_matches.json').open() as file: LOVE_DATA = sorted((int(key), value) for key, value in LOVE_DATA.items()) -class LoveCalculator: +class LoveCalculator(Cog): """ A cog for calculating the love between two people """ diff --git a/bot/seasons/valentines/movie_generator.py b/bot/seasons/valentines/movie_generator.py index b52eba7f..ff0bb86b 100644 --- a/bot/seasons/valentines/movie_generator.py +++ b/bot/seasons/valentines/movie_generator.py @@ -11,7 +11,7 @@ TMDB_API_KEY = environ.get("TMDB_API_KEY") log = logging.getLogger(__name__) -class RomanceMovieFinder: +class RomanceMovieFinder(commands.Cog): """ A cog that returns a random romance movie suggestion to a user """ diff --git a/bot/seasons/valentines/savethedate.py b/bot/seasons/valentines/savethedate.py index b9484be9..f49d9ff4 100644 --- a/bot/seasons/valentines/savethedate.py +++ b/bot/seasons/valentines/savethedate.py @@ -13,7 +13,7 @@ log = logging.getLogger(__name__) HEART_EMOJIS = [":heart:", ":gift_heart:", ":revolving_hearts:", ":sparkling_heart:", ":two_hearts:"] -class SaveTheDate: +class SaveTheDate(commands.Cog): """ A cog that gives random suggestion, for a valentines date ! """ diff --git a/bot/seasons/valentines/valentine_zodiac.py b/bot/seasons/valentines/valentine_zodiac.py index 06c0237d..aa80a7e9 100644 --- a/bot/seasons/valentines/valentine_zodiac.py +++ b/bot/seasons/valentines/valentine_zodiac.py @@ -14,7 +14,7 @@ LETTER_EMOJI = ':love_letter:' HEART_EMOJIS = [":heart:", ":gift_heart:", ":revolving_hearts:", ":sparkling_heart:", ":two_hearts:"] -class ValentineZodiac: +class ValentineZodiac(commands.Cog): """ A cog that returns a counter compatible zodiac sign to the given user's zodiac sign. """ diff --git a/bot/seasons/valentines/whoisvalentine.py b/bot/seasons/valentines/whoisvalentine.py index 2fe07aba..ade4f131 100644 --- a/bot/seasons/valentines/whoisvalentine.py +++ b/bot/seasons/valentines/whoisvalentine.py @@ -14,7 +14,7 @@ with open(Path("bot", "resources", "valentines", "valentine_facts.json"), "r") a FACTS = json.load(file) -class ValentineFacts: +class ValentineFacts(commands.Cog): def __init__(self, bot): self.bot = bot -- cgit v1.2.3 From 721d20c8ab4421a3453afcfd3a6c1338c22b41aa Mon Sep 17 00:00:00 2001 From: sco1 Date: Tue, 5 Mar 2019 16:35:39 -0500 Subject: Set cog load log messages to info Per the contributor doc --- bot/seasons/__init__.py | 2 +- bot/seasons/christmas/adventofcode.py | 2 +- bot/seasons/evergreen/error_handler.py | 2 +- bot/seasons/evergreen/fun.py | 2 +- bot/seasons/evergreen/uptime.py | 2 +- bot/seasons/halloween/candy_collection.py | 2 +- bot/seasons/halloween/hacktoberstats.py | 2 +- bot/seasons/halloween/halloween_facts.py | 2 +- bot/seasons/halloween/halloweenify.py | 2 +- bot/seasons/halloween/monstersurvey.py | 2 +- bot/seasons/halloween/scarymovie.py | 2 +- bot/seasons/halloween/spookyavatar.py | 2 +- bot/seasons/halloween/spookygif.py | 2 +- bot/seasons/halloween/spookyreact.py | 2 +- bot/seasons/halloween/spookysound.py | 2 +- bot/seasons/valentines/be_my_valentine.py | 2 +- bot/seasons/valentines/lovecalculator.py | 1 + bot/seasons/valentines/movie_generator.py | 2 +- bot/seasons/valentines/myvalenstate.py | 2 +- bot/seasons/valentines/savethedate.py | 2 +- bot/seasons/valentines/valentine_zodiac.py | 2 +- bot/seasons/valentines/whoisvalentine.py | 1 + 22 files changed, 22 insertions(+), 20 deletions(-) (limited to 'bot/seasons/christmas/adventofcode.py') diff --git a/bot/seasons/__init__.py b/bot/seasons/__init__.py index c43334a4..7e8cf3ba 100644 --- a/bot/seasons/__init__.py +++ b/bot/seasons/__init__.py @@ -9,4 +9,4 @@ log = logging.getLogger(__name__) def setup(bot): bot.add_cog(SeasonManager(bot)) - log.debug("SeasonManager cog loaded") + log.info("Season manager cog loaded") diff --git a/bot/seasons/christmas/adventofcode.py b/bot/seasons/christmas/adventofcode.py index c74a6f25..60c2a311 100644 --- a/bot/seasons/christmas/adventofcode.py +++ b/bot/seasons/christmas/adventofcode.py @@ -730,4 +730,4 @@ def _error_embed_helper(title: str, description: str) -> discord.Embed: def setup(bot: commands.Bot) -> None: bot.add_cog(AdventOfCode(bot)) - log.info("Cog loaded: adventofcode") + log.info("Advent of Code cog loaded") diff --git a/bot/seasons/evergreen/error_handler.py b/bot/seasons/evergreen/error_handler.py index d764fe86..19c22ed8 100644 --- a/bot/seasons/evergreen/error_handler.py +++ b/bot/seasons/evergreen/error_handler.py @@ -110,4 +110,4 @@ class CommandErrorHandler(commands.Cog): def setup(bot): bot.add_cog(CommandErrorHandler(bot)) - log.debug("CommandErrorHandler cog loaded") + log.info("CommandErrorHandler cog loaded") diff --git a/bot/seasons/evergreen/fun.py b/bot/seasons/evergreen/fun.py index 0003714d..9ef47331 100644 --- a/bot/seasons/evergreen/fun.py +++ b/bot/seasons/evergreen/fun.py @@ -35,4 +35,4 @@ class Fun(commands.Cog): # Required in order to load the cog, use the class name in the add_cog function. def setup(bot): bot.add_cog(Fun(bot)) - log.debug("Fun cog loaded") + log.info("Fun cog loaded") diff --git a/bot/seasons/evergreen/uptime.py b/bot/seasons/evergreen/uptime.py index cce5ae76..3d2c7d03 100644 --- a/bot/seasons/evergreen/uptime.py +++ b/bot/seasons/evergreen/uptime.py @@ -35,4 +35,4 @@ class Uptime(commands.Cog): # Required in order to load the cog, use the class name in the add_cog function. def setup(bot): bot.add_cog(Uptime(bot)) - log.debug("Uptime cog loaded") + log.info("Uptime cog loaded") diff --git a/bot/seasons/halloween/candy_collection.py b/bot/seasons/halloween/candy_collection.py index d75e0d94..87795c77 100644 --- a/bot/seasons/halloween/candy_collection.py +++ b/bot/seasons/halloween/candy_collection.py @@ -233,4 +233,4 @@ class CandyCollection(commands.Cog): def setup(bot): bot.add_cog(CandyCollection(bot)) - log.debug("CandyCollection cog loaded") + log.info("Candy collection cog loaded") diff --git a/bot/seasons/halloween/hacktoberstats.py b/bot/seasons/halloween/hacktoberstats.py index 8ac448b8..41a7f5f2 100644 --- a/bot/seasons/halloween/hacktoberstats.py +++ b/bot/seasons/halloween/hacktoberstats.py @@ -332,4 +332,4 @@ class HacktoberStats(commands.Cog): def setup(bot): bot.add_cog(HacktoberStats(bot)) - log.debug("HacktoberStats cog loaded") + log.info("Hacktober stats cog loaded") diff --git a/bot/seasons/halloween/halloween_facts.py b/bot/seasons/halloween/halloween_facts.py index 64f00ab3..3d833232 100644 --- a/bot/seasons/halloween/halloween_facts.py +++ b/bot/seasons/halloween/halloween_facts.py @@ -64,4 +64,4 @@ class HalloweenFacts(commands.Cog): def setup(bot): bot.add_cog(HalloweenFacts(bot)) - log.debug("HalloweenFacts cog loaded") + log.info("Halloween facts cog loaded") diff --git a/bot/seasons/halloween/halloweenify.py b/bot/seasons/halloween/halloweenify.py index 9e1bae59..0d6964a5 100644 --- a/bot/seasons/halloween/halloweenify.py +++ b/bot/seasons/halloween/halloweenify.py @@ -52,4 +52,4 @@ class Halloweenify(commands.Cog): def setup(bot): bot.add_cog(Halloweenify(bot)) - log.debug("Halloweenify cog loaded") + log.info("Halloweenify cog loaded") diff --git a/bot/seasons/halloween/monstersurvey.py b/bot/seasons/halloween/monstersurvey.py index aa5d97d2..a518ba01 100644 --- a/bot/seasons/halloween/monstersurvey.py +++ b/bot/seasons/halloween/monstersurvey.py @@ -215,4 +215,4 @@ class MonsterSurvey(Cog): def setup(bot): bot.add_cog(MonsterSurvey(bot)) - log.debug("MonsterSurvey cog loaded") + log.info("Monster survey cog loaded") diff --git a/bot/seasons/halloween/scarymovie.py b/bot/seasons/halloween/scarymovie.py index c9a62edf..c331e50e 100644 --- a/bot/seasons/halloween/scarymovie.py +++ b/bot/seasons/halloween/scarymovie.py @@ -138,4 +138,4 @@ class ScaryMovie(commands.Cog): def setup(bot): bot.add_cog(ScaryMovie(bot)) - log.debug("ScaryMovie cog loaded") + log.info("Scary movie cog loaded") diff --git a/bot/seasons/halloween/spookyavatar.py b/bot/seasons/halloween/spookyavatar.py index f26cf0b3..2fe4dcf2 100644 --- a/bot/seasons/halloween/spookyavatar.py +++ b/bot/seasons/halloween/spookyavatar.py @@ -55,4 +55,4 @@ class SpookyAvatar(commands.Cog): def setup(bot): bot.add_cog(SpookyAvatar(bot)) - log.debug("SpookyAvatar cog loaded") + log.info("Spooky avatar cog loaded") diff --git a/bot/seasons/halloween/spookygif.py b/bot/seasons/halloween/spookygif.py index f013f415..054f9b12 100644 --- a/bot/seasons/halloween/spookygif.py +++ b/bot/seasons/halloween/spookygif.py @@ -40,4 +40,4 @@ class SpookyGif(commands.Cog): def setup(bot): bot.add_cog(SpookyGif(bot)) - log.debug("SpookyGif cog loaded") + log.info("Spooky gif cog loaded") diff --git a/bot/seasons/halloween/spookyreact.py b/bot/seasons/halloween/spookyreact.py index 92afe798..229566e9 100644 --- a/bot/seasons/halloween/spookyreact.py +++ b/bot/seasons/halloween/spookyreact.py @@ -71,4 +71,4 @@ class SpookyReact(Cog): def setup(bot): bot.add_cog(SpookyReact(bot)) - log.debug("SpookyReact cog loaded") + log.info("Spooky react cog loaded") diff --git a/bot/seasons/halloween/spookysound.py b/bot/seasons/halloween/spookysound.py index 1fbbfea6..0d3a99bd 100644 --- a/bot/seasons/halloween/spookysound.py +++ b/bot/seasons/halloween/spookysound.py @@ -47,4 +47,4 @@ class SpookySound(commands.Cog): def setup(bot): bot.add_cog(SpookySound(bot)) - log.debug("SpookySound cog loaded") + log.info("Spooky sound cog loaded") diff --git a/bot/seasons/valentines/be_my_valentine.py b/bot/seasons/valentines/be_my_valentine.py index f589dbeb..00fd904c 100644 --- a/bot/seasons/valentines/be_my_valentine.py +++ b/bot/seasons/valentines/be_my_valentine.py @@ -238,4 +238,4 @@ class BeMyValentine(commands.Cog): def setup(bot): bot.add_cog(BeMyValentine(bot)) - log.debug("Be My Valentine cog loaded") + log.info("Be My Valentine cog loaded") diff --git a/bot/seasons/valentines/lovecalculator.py b/bot/seasons/valentines/lovecalculator.py index 655430f5..91dd9fdf 100644 --- a/bot/seasons/valentines/lovecalculator.py +++ b/bot/seasons/valentines/lovecalculator.py @@ -104,3 +104,4 @@ class LoveCalculator(Cog): def setup(bot): bot.add_cog(LoveCalculator(bot)) + log.info("Love calculator cog loaded") \ No newline at end of file diff --git a/bot/seasons/valentines/movie_generator.py b/bot/seasons/valentines/movie_generator.py index ff0bb86b..eb72771c 100644 --- a/bot/seasons/valentines/movie_generator.py +++ b/bot/seasons/valentines/movie_generator.py @@ -63,4 +63,4 @@ class RomanceMovieFinder(commands.Cog): def setup(bot): bot.add_cog(RomanceMovieFinder(bot)) - log.debug("Random romance movie cog loaded!") + log.info("Random romance movie cog loaded") diff --git a/bot/seasons/valentines/myvalenstate.py b/bot/seasons/valentines/myvalenstate.py index 9f06553d..bd07f6a2 100644 --- a/bot/seasons/valentines/myvalenstate.py +++ b/bot/seasons/valentines/myvalenstate.py @@ -82,4 +82,4 @@ class MyValenstate: def setup(bot): bot.add_cog(MyValenstate(bot)) - log.debug("MyValenstate cog loaded") + log.info("My Valenstate cog loaded") diff --git a/bot/seasons/valentines/savethedate.py b/bot/seasons/valentines/savethedate.py index f49d9ff4..830b3015 100644 --- a/bot/seasons/valentines/savethedate.py +++ b/bot/seasons/valentines/savethedate.py @@ -41,4 +41,4 @@ class SaveTheDate(commands.Cog): def setup(bot): bot.add_cog(SaveTheDate(bot)) - log.debug("Save the date cog loaded") + log.info("Save the date cog loaded") diff --git a/bot/seasons/valentines/valentine_zodiac.py b/bot/seasons/valentines/valentine_zodiac.py index aa80a7e9..0e2cb2a1 100644 --- a/bot/seasons/valentines/valentine_zodiac.py +++ b/bot/seasons/valentines/valentine_zodiac.py @@ -56,4 +56,4 @@ class ValentineZodiac(commands.Cog): def setup(bot): bot.add_cog(ValentineZodiac(bot)) - log.debug("Valentine Zodiac cog loaded") + log.info("Valentine Zodiac cog loaded") diff --git a/bot/seasons/valentines/whoisvalentine.py b/bot/seasons/valentines/whoisvalentine.py index ade4f131..4ab02cb5 100644 --- a/bot/seasons/valentines/whoisvalentine.py +++ b/bot/seasons/valentines/whoisvalentine.py @@ -51,3 +51,4 @@ class ValentineFacts(commands.Cog): def setup(bot): bot.add_cog(ValentineFacts(bot)) + log.info("Who Is Valentine? cog loaded") \ No newline at end of file -- cgit v1.2.3 From c998013624ca47a98543a0464f343ae79c8a1627 Mon Sep 17 00:00:00 2001 From: scragly <29337040+scragly@users.noreply.github.com> Date: Tue, 26 Mar 2019 12:39:33 +1000 Subject: Adjust cog load logs to use cog class name. --- bot/seasons/__init__.py | 2 +- bot/seasons/christmas/adventofcode.py | 2 +- bot/seasons/halloween/candy_collection.py | 2 +- bot/seasons/halloween/hacktoberstats.py | 2 +- bot/seasons/halloween/halloween_facts.py | 2 +- bot/seasons/halloween/monstersurvey.py | 2 +- bot/seasons/halloween/scarymovie.py | 2 +- bot/seasons/halloween/spookyavatar.py | 2 +- bot/seasons/halloween/spookygif.py | 2 +- bot/seasons/halloween/spookyreact.py | 2 +- bot/seasons/halloween/spookysound.py | 2 +- bot/seasons/valentines/be_my_valentine.py | 2 +- bot/seasons/valentines/lovecalculator.py | 2 +- bot/seasons/valentines/movie_generator.py | 2 +- bot/seasons/valentines/myvalenstate.py | 2 +- bot/seasons/valentines/savethedate.py | 2 +- bot/seasons/valentines/valentine_zodiac.py | 2 +- bot/seasons/valentines/whoisvalentine.py | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) (limited to 'bot/seasons/christmas/adventofcode.py') diff --git a/bot/seasons/__init__.py b/bot/seasons/__init__.py index 7e8cf3ba..1512fae2 100644 --- a/bot/seasons/__init__.py +++ b/bot/seasons/__init__.py @@ -9,4 +9,4 @@ log = logging.getLogger(__name__) def setup(bot): bot.add_cog(SeasonManager(bot)) - log.info("Season manager cog loaded") + log.info("SeasonManager cog loaded") diff --git a/bot/seasons/christmas/adventofcode.py b/bot/seasons/christmas/adventofcode.py index 60c2a311..2995c3fd 100644 --- a/bot/seasons/christmas/adventofcode.py +++ b/bot/seasons/christmas/adventofcode.py @@ -730,4 +730,4 @@ def _error_embed_helper(title: str, description: str) -> discord.Embed: def setup(bot: commands.Bot) -> None: bot.add_cog(AdventOfCode(bot)) - log.info("Advent of Code cog loaded") + log.info("AdventOfCode cog loaded") diff --git a/bot/seasons/halloween/candy_collection.py b/bot/seasons/halloween/candy_collection.py index 87795c77..6932097c 100644 --- a/bot/seasons/halloween/candy_collection.py +++ b/bot/seasons/halloween/candy_collection.py @@ -233,4 +233,4 @@ class CandyCollection(commands.Cog): def setup(bot): bot.add_cog(CandyCollection(bot)) - log.info("Candy collection cog loaded") + log.info("CandyCollection cog loaded") diff --git a/bot/seasons/halloween/hacktoberstats.py b/bot/seasons/halloween/hacktoberstats.py index 41a7f5f2..81f11455 100644 --- a/bot/seasons/halloween/hacktoberstats.py +++ b/bot/seasons/halloween/hacktoberstats.py @@ -332,4 +332,4 @@ class HacktoberStats(commands.Cog): def setup(bot): bot.add_cog(HacktoberStats(bot)) - log.info("Hacktober stats cog loaded") + log.info("HacktoberStats cog loaded") diff --git a/bot/seasons/halloween/halloween_facts.py b/bot/seasons/halloween/halloween_facts.py index 3d833232..9224cc57 100644 --- a/bot/seasons/halloween/halloween_facts.py +++ b/bot/seasons/halloween/halloween_facts.py @@ -64,4 +64,4 @@ class HalloweenFacts(commands.Cog): def setup(bot): bot.add_cog(HalloweenFacts(bot)) - log.info("Halloween facts cog loaded") + log.info("HalloweenFacts cog loaded") diff --git a/bot/seasons/halloween/monstersurvey.py b/bot/seasons/halloween/monstersurvey.py index a518ba01..2b251b90 100644 --- a/bot/seasons/halloween/monstersurvey.py +++ b/bot/seasons/halloween/monstersurvey.py @@ -215,4 +215,4 @@ class MonsterSurvey(Cog): def setup(bot): bot.add_cog(MonsterSurvey(bot)) - log.info("Monster survey cog loaded") + log.info("MonsterSurvey cog loaded") diff --git a/bot/seasons/halloween/scarymovie.py b/bot/seasons/halloween/scarymovie.py index c331e50e..dcff4f58 100644 --- a/bot/seasons/halloween/scarymovie.py +++ b/bot/seasons/halloween/scarymovie.py @@ -138,4 +138,4 @@ class ScaryMovie(commands.Cog): def setup(bot): bot.add_cog(ScaryMovie(bot)) - log.info("Scary movie cog loaded") + log.info("ScaryMovie cog loaded") diff --git a/bot/seasons/halloween/spookyavatar.py b/bot/seasons/halloween/spookyavatar.py index 2fe4dcf2..032ad352 100644 --- a/bot/seasons/halloween/spookyavatar.py +++ b/bot/seasons/halloween/spookyavatar.py @@ -55,4 +55,4 @@ class SpookyAvatar(commands.Cog): def setup(bot): bot.add_cog(SpookyAvatar(bot)) - log.info("Spooky avatar cog loaded") + log.info("SpookyAvatar cog loaded") diff --git a/bot/seasons/halloween/spookygif.py b/bot/seasons/halloween/spookygif.py index 054f9b12..c11d5ecb 100644 --- a/bot/seasons/halloween/spookygif.py +++ b/bot/seasons/halloween/spookygif.py @@ -40,4 +40,4 @@ class SpookyGif(commands.Cog): def setup(bot): bot.add_cog(SpookyGif(bot)) - log.info("Spooky gif cog loaded") + log.info("SpookyGif cog loaded") diff --git a/bot/seasons/halloween/spookyreact.py b/bot/seasons/halloween/spookyreact.py index 229566e9..3b4e3fdf 100644 --- a/bot/seasons/halloween/spookyreact.py +++ b/bot/seasons/halloween/spookyreact.py @@ -71,4 +71,4 @@ class SpookyReact(Cog): def setup(bot): bot.add_cog(SpookyReact(bot)) - log.info("Spooky react cog loaded") + log.info("SpookyReact cog loaded") diff --git a/bot/seasons/halloween/spookysound.py b/bot/seasons/halloween/spookysound.py index 0d3a99bd..1e430dab 100644 --- a/bot/seasons/halloween/spookysound.py +++ b/bot/seasons/halloween/spookysound.py @@ -47,4 +47,4 @@ class SpookySound(commands.Cog): def setup(bot): bot.add_cog(SpookySound(bot)) - log.info("Spooky sound cog loaded") + log.info("SpookySound cog loaded") diff --git a/bot/seasons/valentines/be_my_valentine.py b/bot/seasons/valentines/be_my_valentine.py index 00fd904c..4e2182c3 100644 --- a/bot/seasons/valentines/be_my_valentine.py +++ b/bot/seasons/valentines/be_my_valentine.py @@ -238,4 +238,4 @@ class BeMyValentine(commands.Cog): def setup(bot): bot.add_cog(BeMyValentine(bot)) - log.info("Be My Valentine cog loaded") + log.info("BeMyValentine cog loaded") diff --git a/bot/seasons/valentines/lovecalculator.py b/bot/seasons/valentines/lovecalculator.py index 2b6dc759..0662cf5b 100644 --- a/bot/seasons/valentines/lovecalculator.py +++ b/bot/seasons/valentines/lovecalculator.py @@ -104,4 +104,4 @@ class LoveCalculator(Cog): def setup(bot): bot.add_cog(LoveCalculator(bot)) - log.info("Love calculator cog loaded") + log.info("LoveCalculator cog loaded") diff --git a/bot/seasons/valentines/movie_generator.py b/bot/seasons/valentines/movie_generator.py index eb72771c..8fce011b 100644 --- a/bot/seasons/valentines/movie_generator.py +++ b/bot/seasons/valentines/movie_generator.py @@ -63,4 +63,4 @@ class RomanceMovieFinder(commands.Cog): def setup(bot): bot.add_cog(RomanceMovieFinder(bot)) - log.info("Random romance movie cog loaded") + log.info("RomanceMovieFinder cog loaded") diff --git a/bot/seasons/valentines/myvalenstate.py b/bot/seasons/valentines/myvalenstate.py index efc374d4..7d9f3a59 100644 --- a/bot/seasons/valentines/myvalenstate.py +++ b/bot/seasons/valentines/myvalenstate.py @@ -82,4 +82,4 @@ class MyValenstate(commands.Cog): def setup(bot): bot.add_cog(MyValenstate(bot)) - log.info("My Valenstate cog loaded") + log.info("MyValenstate cog loaded") diff --git a/bot/seasons/valentines/savethedate.py b/bot/seasons/valentines/savethedate.py index 830b3015..f587c2fc 100644 --- a/bot/seasons/valentines/savethedate.py +++ b/bot/seasons/valentines/savethedate.py @@ -41,4 +41,4 @@ class SaveTheDate(commands.Cog): def setup(bot): bot.add_cog(SaveTheDate(bot)) - log.info("Save the date cog loaded") + log.info("SaveTheDate cog loaded") diff --git a/bot/seasons/valentines/valentine_zodiac.py b/bot/seasons/valentines/valentine_zodiac.py index 0e2cb2a1..33fc739a 100644 --- a/bot/seasons/valentines/valentine_zodiac.py +++ b/bot/seasons/valentines/valentine_zodiac.py @@ -56,4 +56,4 @@ class ValentineZodiac(commands.Cog): def setup(bot): bot.add_cog(ValentineZodiac(bot)) - log.info("Valentine Zodiac cog loaded") + log.info("ValentineZodiac cog loaded") diff --git a/bot/seasons/valentines/whoisvalentine.py b/bot/seasons/valentines/whoisvalentine.py index 433ff251..59a13ca3 100644 --- a/bot/seasons/valentines/whoisvalentine.py +++ b/bot/seasons/valentines/whoisvalentine.py @@ -51,4 +51,4 @@ class ValentineFacts(commands.Cog): def setup(bot): bot.add_cog(ValentineFacts(bot)) - log.info("Who Is Valentine? cog loaded") + log.info("ValentineFacts cog loaded") -- cgit v1.2.3