From da13946c4d05b03d0e3df79befb855d6898ba83c Mon Sep 17 00:00:00 2001 From: Gustav Odinger Date: Mon, 21 Sep 2020 19:55:35 +0200 Subject: Update constants.py to include URLs - Includes bot_avatar and github_bot_repo URLs - Necessary for extensions.py cog to work --- bot/constants.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'bot/constants.py') diff --git a/bot/constants.py b/bot/constants.py index fa428a61..07b040fc 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -24,6 +24,7 @@ __all__ = ( "ERROR_REPLIES", "NEGATIVE_REPLIES", "POSITIVE_REPLIES", + "URLs" ) log = logging.getLogger(__name__) @@ -177,6 +178,12 @@ class Roles(NamedTuple): verified = 352427296948486144 helpers = 267630620367257601 rockstars = 458226413825294336 + core_developers = 757650781385261197 # Change this value for local test servers. + + +class URLs: + bot_avatar = "https://raw.githubusercontent.com/discord-python/branding/master/logos/logo_circle/logo_circle.png" + github_bot_repo = "https://github.com/python-discord/bot" class Tokens(NamedTuple): -- cgit v1.2.3 From 318200d8d340acbad79694a4f541adf421234a94 Mon Sep 17 00:00:00 2001 From: Gustav Odinger Date: Mon, 21 Sep 2020 20:08:46 +0200 Subject: Add status emojis in constants.py - Required for extensions.py to work properly --- bot/constants.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'bot/constants.py') diff --git a/bot/constants.py b/bot/constants.py index 07b040fc..20d950cb 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -123,6 +123,11 @@ class Emojis: pull_request_closed = "<:PRClosed:629695470519713818>" merge = "<:PRMerged:629695470570176522>" + status_online = "<:status_online:470326272351010816>" + status_idle = "<:status_idle:470326266625785866>" + status_dnd = "<:status_dnd:470326272082313216>" + status_offline = "<:status_offline:470326266537705472>" + class Hacktoberfest(NamedTuple): voice_id = 514420006474219521 -- cgit v1.2.3 From 65f044b975b18f5fd34f22a8b8e4567705ba68c6 Mon Sep 17 00:00:00 2001 From: Gustav Odinger Date: Mon, 21 Sep 2020 20:17:01 +0200 Subject: Fix core developers role id - Previous versions used the id from a local test server - This version uses the PyDis core developer role --- 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 20d950cb..e7d4265e 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -183,7 +183,7 @@ class Roles(NamedTuple): verified = 352427296948486144 helpers = 267630620367257601 rockstars = 458226413825294336 - core_developers = 757650781385261197 # Change this value for local test servers. + core_developers = 587606783669829632 class URLs: -- cgit v1.2.3 From 13ef604bd43a5eae4b1b3ade8670ceca1fc4592a Mon Sep 17 00:00:00 2001 From: Gustav Odinger Date: Mon, 21 Sep 2020 23:19:50 +0200 Subject: Move bot repo URL constant and delete avatar URL - Avatar URL can be accessed through bot.user.avatar_url and won't need to be a constant - Bot repo URL fits better under the Client named tuple - URLs class removed, since it was no longer used --- bot/constants.py | 6 +----- bot/exts/utils/extensions.py | 6 +++--- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'bot/constants.py') diff --git a/bot/constants.py b/bot/constants.py index e7d4265e..c69d5a83 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -85,6 +85,7 @@ class Client(NamedTuple): token = environ.get("SEASONALBOT_TOKEN") sentry_dsn = environ.get("SEASONALBOT_SENTRY_DSN") debug = environ.get("SEASONALBOT_DEBUG", "").lower() == "true" + github_bot_repo = "https://github.com/python-discord/bot" # Override seasonal locks: 1 (January) to 12 (December) month_override = int(environ["MONTH_OVERRIDE"]) if "MONTH_OVERRIDE" in environ else None @@ -186,11 +187,6 @@ class Roles(NamedTuple): core_developers = 587606783669829632 -class URLs: - bot_avatar = "https://raw.githubusercontent.com/discord-python/branding/master/logos/logo_circle/logo_circle.png" - github_bot_repo = "https://github.com/python-discord/bot" - - class Tokens(NamedTuple): giphy = environ.get("GIPHY_TOKEN") aoc_session_cookie = environ.get("AOC_SESSION_COOKIE") diff --git a/bot/exts/utils/extensions.py b/bot/exts/utils/extensions.py index 834b7d4f..65dfef84 100644 --- a/bot/exts/utils/extensions.py +++ b/bot/exts/utils/extensions.py @@ -9,7 +9,7 @@ from discord.ext.commands import Context, group from bot import exts from bot.bot import SeasonalBot as Bot -from bot.constants import Emojis, MODERATION_ROLES, Roles, URLs +from bot.constants import Client, Emojis, MODERATION_ROLES, Roles from bot.utils.checks import with_role_check from bot.utils.extensions import EXTENSIONS, unqualify from bot.utils.pagination import LinePaginator @@ -154,8 +154,8 @@ class Extensions(commands.Cog): embed = Embed(colour=Colour.blurple()) embed.set_author( name="Extensions List", - url=URLs.github_bot_repo, - icon_url=URLs.bot_avatar + url=Client.github_bot_repo, + icon_url=str(Bot.user.avatar_url) ) lines = [] -- cgit v1.2.3 From b94e4613a4e9e10eb8126f4c67c9ed73d1ecc32f Mon Sep 17 00:00:00 2001 From: gustavwilliam <65498475+gustavwilliam@users.noreply.github.com> Date: Tue, 22 Sep 2020 18:43:36 +0200 Subject: Fix GitHub repo link constant - Previous version was pointing to Python, not SeasonalBot Co-authored-by: Dennis Pham --- 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 c69d5a83..2d6bfa1b 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -85,7 +85,7 @@ class Client(NamedTuple): token = environ.get("SEASONALBOT_TOKEN") sentry_dsn = environ.get("SEASONALBOT_SENTRY_DSN") debug = environ.get("SEASONALBOT_DEBUG", "").lower() == "true" - github_bot_repo = "https://github.com/python-discord/bot" + github_bot_repo = "https://github.com/python-discord/seasonalbot" # Override seasonal locks: 1 (January) to 12 (December) month_override = int(environ["MONTH_OVERRIDE"]) if "MONTH_OVERRIDE" in environ else None -- cgit v1.2.3 From 32b03f64acb1ea87d6206be014949ed2e756b196 Mon Sep 17 00:00:00 2001 From: Gustav Odinger Date: Tue, 22 Sep 2020 18:45:50 +0200 Subject: Remove non-existing class reference in constants - Since URLs no longer exists, it's now removed from __all__ --- bot/constants.py | 1 - 1 file changed, 1 deletion(-) (limited to 'bot/constants.py') diff --git a/bot/constants.py b/bot/constants.py index 2d6bfa1b..f3424673 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -24,7 +24,6 @@ __all__ = ( "ERROR_REPLIES", "NEGATIVE_REPLIES", "POSITIVE_REPLIES", - "URLs" ) log = logging.getLogger(__name__) -- cgit v1.2.3 From 5f8b67244562317ffc5648eff53bf35fb0d5faa9 Mon Sep 17 00:00:00 2001 From: Sebastiaan Zeeff Date: Wed, 30 Sep 2020 21:27:20 +0200 Subject: Remove SpookySound Cog that played sounds in voice We had an old Cog that would allow our members to run a command to make Seasonal Bot join a voice channel to play a spooky sound. However, as our voice channel use has changed over the past year, we don't think that it's still a good idea to do this. That's why I removed the Cog and the constants related to it. --- bot/constants.py | 5 ---- bot/exts/halloween/spookysound.py | 48 --------------------------------------- 2 files changed, 53 deletions(-) delete mode 100644 bot/exts/halloween/spookysound.py (limited to 'bot/constants.py') diff --git a/bot/constants.py b/bot/constants.py index 935b90e0..0c376344 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -11,7 +11,6 @@ __all__ = ( "Client", "Colours", "Emojis", - "Hacktoberfest", "Icons", "Lovefest", "Month", @@ -129,10 +128,6 @@ class Emojis: status_offline = "<:status_offline:470326266537705472>" -class Hacktoberfest(NamedTuple): - voice_id = 514420006474219521 - - class Icons: questionmark = "https://cdn.discordapp.com/emojis/512367613339369475.png" bookmark = ( diff --git a/bot/exts/halloween/spookysound.py b/bot/exts/halloween/spookysound.py deleted file mode 100644 index 569a9153..00000000 --- a/bot/exts/halloween/spookysound.py +++ /dev/null @@ -1,48 +0,0 @@ -import logging -import random -from pathlib import Path - -import discord -from discord.ext import commands - -from bot.bot import SeasonalBot -from bot.constants import Hacktoberfest - -log = logging.getLogger(__name__) - - -class SpookySound(commands.Cog): - """A cog that plays a spooky sound in a voice channel on command.""" - - def __init__(self, bot: SeasonalBot): - self.bot = bot - self.sound_files = list(Path("bot/resources/halloween/spookysounds").glob("*.mp3")) - self.channel = None - - @commands.cooldown(rate=1, per=1) - @commands.command(brief="Play a spooky sound, restricted to once per 2 mins") - async def spookysound(self, ctx: commands.Context) -> None: - """ - Connect to the Hacktoberbot voice channel, play a random spooky sound, then disconnect. - - Cannot be used more than once in 2 minutes. - """ - if not self.channel: - await self.bot.wait_until_guild_available() - self.channel = self.bot.get_channel(Hacktoberfest.voice_id) - - await ctx.send("Initiating spooky sound...") - file_path = random.choice(self.sound_files) - src = discord.FFmpegPCMAudio(str(file_path.resolve())) - voice = await self.channel.connect() - voice.play(src, after=lambda e: self.bot.loop.create_task(self.disconnect(voice))) - - @staticmethod - async def disconnect(voice: discord.VoiceClient) -> None: - """Helper method to disconnect a given voice client.""" - await voice.disconnect() - - -def setup(bot: SeasonalBot) -> None: - """Spooky sound Cog load.""" - bot.add_cog(SpookySound(bot)) -- cgit v1.2.3 From 15324b3428e80d2e7a37ba84443983684e834ffc Mon Sep 17 00:00:00 2001 From: Sebastiaan Zeeff Date: Wed, 30 Sep 2020 21:29:11 +0200 Subject: Update the Hacktoberfest channel constant I've updated the Hacktoberfest channel ID to the ID of the new channel just created for the 2020 edition of the event. --- bot/constants.py | 2 +- bot/exts/halloween/hacktoberstats.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'bot/constants.py') diff --git a/bot/constants.py b/bot/constants.py index 0c376344..7ec8ac27 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -74,7 +74,7 @@ class Channels(NamedTuple): python_discussion = 267624335836053506 show_your_projects = int(environ.get("CHANNEL_SHOW_YOUR_PROJECTS", 303934982764625920)) show_your_projects_discussion = 360148304664723466 - hacktoberfest_2019 = 628184417646411776 + hacktoberfest_2020 = 760857070781071431 class Client(NamedTuple): diff --git a/bot/exts/halloween/hacktoberstats.py b/bot/exts/halloween/hacktoberstats.py index db5e37f2..92429c1b 100644 --- a/bot/exts/halloween/hacktoberstats.py +++ b/bot/exts/halloween/hacktoberstats.py @@ -18,7 +18,7 @@ log = logging.getLogger(__name__) CURRENT_YEAR = datetime.now().year # Used to construct GH API query PRS_FOR_SHIRT = 4 # Minimum number of PRs before a shirt is awarded -HACKTOBER_WHITELIST = WHITELISTED_CHANNELS + (Channels.hacktoberfest_2019,) +HACKTOBER_WHITELIST = WHITELISTED_CHANNELS + (Channels.hacktoberfest_2020,) class HacktoberStats(commands.Cog): -- cgit v1.2.3