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