From 05fd9426e18effddc0f2b9293bca5ab174b526b6 Mon Sep 17 00:00:00 2001 From: Rohan Date: Sun, 31 Mar 2019 12:12:25 +0530 Subject: using the Colours from constants.py and added 2 colors - blue for christmas and yellow for easter --- bot/constants.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'bot/constants.py') diff --git a/bot/constants.py b/bot/constants.py index b19d494b..3896dd83 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -59,6 +59,8 @@ class Client(NamedTuple): class Colours: + blue = 0x0279fd + yellow = 0xf9f586 soft_red = 0xcd6d6d soft_green = 0x68c290 bright_green = 0x01d277 -- cgit v1.2.3 From 033794a505af0debb2d1db08fac17676f3a0f64f Mon Sep 17 00:00:00 2001 From: Rohan Date: Sun, 31 Mar 2019 14:27:49 +0530 Subject: added doc strings to setup function and removed yellow color from constants cuz ill add it when i make PR for easter --- bot/constants.py | 1 - bot/seasons/christmas/hanukkah_embed.py | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) (limited to 'bot/constants.py') diff --git a/bot/constants.py b/bot/constants.py index 3896dd83..993a0f81 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -60,7 +60,6 @@ class Client(NamedTuple): class Colours: blue = 0x0279fd - yellow = 0xf9f586 soft_red = 0xcd6d6d soft_green = 0x68c290 bright_green = 0x01d277 diff --git a/bot/seasons/christmas/hanukkah_embed.py b/bot/seasons/christmas/hanukkah_embed.py index 85d91675..ca69999e 100644 --- a/bot/seasons/christmas/hanukkah_embed.py +++ b/bot/seasons/christmas/hanukkah_embed.py @@ -108,5 +108,6 @@ class HanukkahEmbed(commands.Cog): def setup(bot): + """A function to add the cog.""" bot.add_cog(HanukkahEmbed(bot)) log.info("Hanukkah embed cog loaded") -- cgit v1.2.3 From 1049ee3e51ca4dcc3faa6ab02f378fadf5ec231f Mon Sep 17 00:00:00 2001 From: Suhail Date: Tue, 23 Apr 2019 18:28:04 +0100 Subject: Constants cleaning --- bot/constants.py | 3 --- bot/seasons/christmas/adventofcode.py | 4 ++-- bot/seasons/halloween/candy_collection.py | 10 +++++----- bot/seasons/halloween/halloween_facts.py | 4 ++-- bot/seasons/valentines/be_my_valentine.py | 4 ++-- 5 files changed, 11 insertions(+), 14 deletions(-) (limited to 'bot/constants.py') diff --git a/bot/constants.py b/bot/constants.py index d362c90e..52c76cda 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -18,7 +18,6 @@ class AdventOfCode: leaderboard_join_code = str(environ.get("AOC_JOIN_CODE", None)) leaderboard_max_displayed_members = 10 year = 2018 - channel_id = int(environ.get("AOC_CHANNEL_ID", 517745814039166986)) role_id = int(environ.get("AOC_ROLE_ID", 518565788744024082)) @@ -84,12 +83,10 @@ class Emojis: class Lovefest: - channel_id = int(environ.get("LOVEFEST_CHANNEL_ID", 542272993192050698)) role_id = int(environ.get("LOVEFEST_ROLE_ID", 542431903886606399)) class Hacktoberfest(NamedTuple): - channel_id = 498804484324196362 voice_id = 514420006474219521 diff --git a/bot/seasons/christmas/adventofcode.py b/bot/seasons/christmas/adventofcode.py index 5d05dce6..32858673 100644 --- a/bot/seasons/christmas/adventofcode.py +++ b/bot/seasons/christmas/adventofcode.py @@ -13,7 +13,7 @@ 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, Channels, Colours, Emojis, Tokens log = logging.getLogger(__name__) @@ -88,7 +88,7 @@ async def day_countdown(bot: commands.Bot): await asyncio.sleep(time_left.seconds) - channel = bot.get_channel(AocConfig.channel_id) + channel = bot.get_channel(Channels.seasonalbot_chat) if not channel: log.error("Could not find the AoC channel to send notification in") diff --git a/bot/seasons/halloween/candy_collection.py b/bot/seasons/halloween/candy_collection.py index 70648e64..f8ab4c60 100644 --- a/bot/seasons/halloween/candy_collection.py +++ b/bot/seasons/halloween/candy_collection.py @@ -7,7 +7,7 @@ import random import discord from discord.ext import commands -from bot.constants import Hacktoberfest +from bot.constants import Channels log = logging.getLogger(__name__) @@ -41,7 +41,7 @@ class CandyCollection(commands.Cog): if message.author.bot: return # ensure it's hacktober channel - if message.channel.id != Hacktoberfest.channel_id: + if message.channel.id != Channels.seasonalbot_chat: return # do random check for skull first as it has the lower chance @@ -65,7 +65,7 @@ class CandyCollection(commands.Cog): return # check to ensure it is in correct channel - if message.channel.id != Hacktoberfest.channel_id: + if message.channel.id != Channels.seasonalbot_chat: return # if its not a candy or skull, and it is one of 10 most recent messages, @@ -127,7 +127,7 @@ class CandyCollection(commands.Cog): ten_recent = [] recent_msg = max(message.id for message in self.bot._connection._messages - if message.channel.id == Hacktoberfest.channel_id) + if message.channel.id == Channels.seasonalbot_chat) channel = await self.hacktober_channel() ten_recent.append(recent_msg.id) @@ -159,7 +159,7 @@ class CandyCollection(commands.Cog): async def hacktober_channel(self): """Get #hacktoberbot channel from its ID.""" - return self.bot.get_channel(id=Hacktoberfest.channel_id) + return self.bot.get_channel(id=Channels.seasonalbot_chat) async def remove_reactions(self, reaction): """Remove all candy/skull reactions.""" diff --git a/bot/seasons/halloween/halloween_facts.py b/bot/seasons/halloween/halloween_facts.py index ee90dbd3..ad9aa716 100644 --- a/bot/seasons/halloween/halloween_facts.py +++ b/bot/seasons/halloween/halloween_facts.py @@ -7,7 +7,7 @@ from pathlib import Path import discord from discord.ext import commands -from bot.constants import Hacktoberfest +from bot.constants import Channels log = logging.getLogger(__name__) @@ -40,7 +40,7 @@ class HalloweenFacts(commands.Cog): async def on_ready(self): """Get event Channel object and initialize fact task loop.""" - self.channel = self.bot.get_channel(Hacktoberfest.channel_id) + self.channel = self.bot.get_channel(Channels.seasonalbot_chat) self.bot.loop.create_task(self._fact_publisher_task()) def random_fact(self): diff --git a/bot/seasons/valentines/be_my_valentine.py b/bot/seasons/valentines/be_my_valentine.py index 55c4adb1..19788577 100644 --- a/bot/seasons/valentines/be_my_valentine.py +++ b/bot/seasons/valentines/be_my_valentine.py @@ -8,7 +8,7 @@ import discord from discord.ext import commands from discord.ext.commands.cooldowns import BucketType -from bot.constants import Client, Colours, Lovefest +from bot.constants import Channels, Client, Colours, Lovefest log = logging.getLogger(__name__) @@ -99,7 +99,7 @@ class BeMyValentine(commands.Cog): emoji_1, emoji_2 = self.random_emoji() lovefest_role = discord.utils.get(ctx.guild.roles, id=Lovefest.role_id) - channel = self.bot.get_channel(Lovefest.channel_id) + channel = self.bot.get_channel(Channels.seasonalbot_chat) valentine, title = self.valentine_check(valentine_type) if user is None: -- cgit v1.2.3 From 0a26ef46dd4b610d8d7474e70fce4dbafc0279a9 Mon Sep 17 00:00:00 2001 From: RohanRadia Date: Mon, 13 May 2019 14:54:13 +0100 Subject: Added the show projects channels to the constants file. --- bot/constants.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'bot/constants.py') diff --git a/bot/constants.py b/bot/constants.py index bf542daf..f424f943 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -18,6 +18,7 @@ class AdventOfCode: leaderboard_join_code = str(environ.get("AOC_JOIN_CODE", None)) leaderboard_max_displayed_members = 10 year = 2018 + channel_id = int(environ.get("AOC_CHANNEL_ID", 517745814039166986)) role_id = int(environ.get("AOC_ROLE_ID", 518565788744024082)) @@ -28,7 +29,7 @@ class Channels(NamedTuple): bot = 267659945086812160 checkpoint_test = 422077681434099723 devalerts = 460181980097675264 - devlog = int(environ.get('CHANNEL_DEVLOG', 548438471685963776)) + devlog = int(environ.get('CHANNEL_DEVLOG', 409308876241108992)) devtest = 414574275865870337 help_0 = 303906576991780866 help_1 = 303906556754395136 @@ -45,29 +46,27 @@ class Channels(NamedTuple): off_topic_2 = 463035268514185226 python = 267624335836053506 reddit = 458224812528238616 - seasonalbot_chat = int(environ.get('CHANNEL_SEASONALBOT_CHAT', 542272993192050698)) staff_lounge = 464905259261755392 verification = 352442727016693763 - python_discussion = 267624335836053506 + show_your_projects = 303934982764625920 + show_your_projects_discussion = 360148304664723466 class Client(NamedTuple): guild = int(environ.get('SEASONALBOT_GUILD', 267624335836053506)) - prefix = environ.get("PREFIX", ".") + prefix = "." token = environ.get('SEASONALBOT_TOKEN') debug = environ.get('SEASONALBOT_DEBUG', '').lower() == 'true' season_override = environ.get('SEASON_OVERRIDE') class Colours: - blue = 0x0279fd + soft_red = 0xcd6d6d + soft_green = 0x68c290 bright_green = 0x01d277 dark_green = 0x1f8b4c orange = 0xe67e22 pink = 0xcf84e0 - soft_green = 0x68c290 - soft_red = 0xcd6d6d - yellow = 0xf9f586 class Emojis: @@ -84,10 +83,12 @@ class Emojis: class Lovefest: + channel_id = int(environ.get("LOVEFEST_CHANNEL_ID", 542272993192050698)) role_id = int(environ.get("LOVEFEST_ROLE_ID", 542431903886606399)) class Hacktoberfest(NamedTuple): + channel_id = 498804484324196362 voice_id = 514420006474219521 -- cgit v1.2.3 From 7593eafd8ca2b5dfda66fa78cfe6fc0646ceeb65 Mon Sep 17 00:00:00 2001 From: RohanRadia Date: Mon, 13 May 2019 15:42:52 +0100 Subject: Fixed broken constants commit with accidental changes. --- bot/constants.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'bot/constants.py') diff --git a/bot/constants.py b/bot/constants.py index f424f943..211abf9e 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -18,7 +18,6 @@ class AdventOfCode: leaderboard_join_code = str(environ.get("AOC_JOIN_CODE", None)) leaderboard_max_displayed_members = 10 year = 2018 - channel_id = int(environ.get("AOC_CHANNEL_ID", 517745814039166986)) role_id = int(environ.get("AOC_ROLE_ID", 518565788744024082)) @@ -29,7 +28,7 @@ class Channels(NamedTuple): bot = 267659945086812160 checkpoint_test = 422077681434099723 devalerts = 460181980097675264 - devlog = int(environ.get('CHANNEL_DEVLOG', 409308876241108992)) + devlog = int(environ.get('CHANNEL_DEVLOG', 548438471685963776)) devtest = 414574275865870337 help_0 = 303906576991780866 help_1 = 303906556754395136 @@ -46,27 +45,31 @@ class Channels(NamedTuple): off_topic_2 = 463035268514185226 python = 267624335836053506 reddit = 458224812528238616 + seasonalbot_chat = int(environ.get('CHANNEL_SEASONALBOT_CHAT', 542272993192050698)) staff_lounge = 464905259261755392 verification = 352442727016693763 + python_discussion = 267624335836053506 show_your_projects = 303934982764625920 show_your_projects_discussion = 360148304664723466 class Client(NamedTuple): guild = int(environ.get('SEASONALBOT_GUILD', 267624335836053506)) - prefix = "." + prefix = environ.get("PREFIX", ".") token = environ.get('SEASONALBOT_TOKEN') debug = environ.get('SEASONALBOT_DEBUG', '').lower() == 'true' season_override = environ.get('SEASON_OVERRIDE') class Colours: - soft_red = 0xcd6d6d - soft_green = 0x68c290 + blue = 0x0279fd bright_green = 0x01d277 dark_green = 0x1f8b4c orange = 0xe67e22 pink = 0xcf84e0 + soft_green = 0x68c290 + soft_red = 0xcd6d6d + yellow = 0xf9f586 class Emojis: @@ -83,12 +86,10 @@ class Emojis: class Lovefest: - channel_id = int(environ.get("LOVEFEST_CHANNEL_ID", 542272993192050698)) role_id = int(environ.get("LOVEFEST_ROLE_ID", 542431903886606399)) class Hacktoberfest(NamedTuple): - channel_id = 498804484324196362 voice_id = 514420006474219521 @@ -129,4 +130,4 @@ ERROR_REPLIES = [ ] -bot = SeasonalBot(command_prefix=Client.prefix) +bot = SeasonalBot(command_prefix=Client.prefix) \ No newline at end of file -- cgit v1.2.3 From 48ec21106e54f9b1bae99a7700bd3c7523a8e2f0 Mon Sep 17 00:00:00 2001 From: RohanRadia Date: Tue, 14 May 2019 18:09:43 +0100 Subject: Update bot/constants.py Co-Authored-By: Daniel Brown --- bot/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bot/constants.py') diff --git a/bot/constants.py b/bot/constants.py index 211abf9e..67dd9328 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -130,4 +130,4 @@ ERROR_REPLIES = [ ] -bot = SeasonalBot(command_prefix=Client.prefix) \ No newline at end of file +bot = SeasonalBot(command_prefix=Client.prefix) -- cgit v1.2.3