From 9e01d6b85dd27d8ecb5f00a5cf20f332d534e584 Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 20 Mar 2021 11:13:46 +0000 Subject: Only output override channels & bot commands channel on whitelist error Previously this would output all channels, and could result in an error. This change ensures only the main bot channel & and any overridden channels are shown in the embed. We do this before the categories block as the categories kwarg itself is an override, so we want to include those in any output. --- bot/utils/decorators.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bot/utils/decorators.py b/bot/utils/decorators.py index c12a15ff..f0e2ff99 100644 --- a/bot/utils/decorators.py +++ b/bot/utils/decorators.py @@ -11,7 +11,7 @@ from discord import Colour, Embed from discord.ext import commands from discord.ext.commands import CheckFailure, Command, Context -from bot.constants import ERROR_REPLIES, Month +from bot.constants import Channels, ERROR_REPLIES, Month, WHITELISTED_CHANNELS from bot.utils import human_months, resolve_current_month from bot.utils.checks import in_whitelist_check @@ -253,6 +253,12 @@ def whitelist_check(**default_kwargs: t.Container[int]) -> t.Callable[[Context], channels = set(kwargs.get("channels") or {}) categories = kwargs.get("categories") + # Only output override channels + community_bot_commands + if channels: + default_whitelist_channels = set(WHITELISTED_CHANNELS) + default_whitelist_channels.discard(Channels.community_bot_commands) + channels.difference_update(default_whitelist_channels) + # Add all whitelisted category channels if categories: for category_id in categories: -- cgit v1.2.3 From 1e9a88f5b59cf7d1c4e24f48cc09aa98e5f6499b Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 21 Mar 2021 18:11:50 +0000 Subject: Replace list comp with a set update + sequence --- bot/utils/decorators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/utils/decorators.py b/bot/utils/decorators.py index f0e2ff99..60066dc4 100644 --- a/bot/utils/decorators.py +++ b/bot/utils/decorators.py @@ -266,7 +266,7 @@ def whitelist_check(**default_kwargs: t.Container[int]) -> t.Callable[[Context], if category is None: continue - [channels.add(channel.id) for channel in category.text_channels] + channels.update(channel.id for channel in category.text_channels) if channels: channels_str = ', '.join(f"<#{c_id}>" for c_id in channels) -- cgit v1.2.3 From faccb5d2828d046d5e3a1e21c63f392529be4691 Mon Sep 17 00:00:00 2001 From: Matteo Bertucci Date: Wed, 24 Mar 2021 09:24:32 +0100 Subject: Remove broken link from the April fool collection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Its’a braken --- bot/resources/easter/april_fools_vids.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/bot/resources/easter/april_fools_vids.json b/bot/resources/easter/april_fools_vids.json index 5f0ba06e..d8c1efa1 100644 --- a/bot/resources/easter/april_fools_vids.json +++ b/bot/resources/easter/april_fools_vids.json @@ -16,10 +16,6 @@ "title": "Haptic Helpers: bringing you to your senses", "link": "https://youtu.be/3MA6_21nka8" }, - { - "title": "Introducing Google Gnome", - "link": "https://youtu.be/vNOllWX-2aE" - }, { "title": "Introducing Google Wind", "link": "https://youtu.be/QAwL0O5nXe0" -- cgit v1.2.3 From f6a28d5833160dccb6d308fd8e27c6afb9729643 Mon Sep 17 00:00:00 2001 From: Neil Shah <78612612+NeilShah2026@users.noreply.github.com> Date: Fri, 26 Mar 2021 09:50:03 -0400 Subject: Added 3 More Elements To The Json --- bot/resources/easter/april_fools_vids.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bot/resources/easter/april_fools_vids.json b/bot/resources/easter/april_fools_vids.json index d8c1efa1..d029ff86 100644 --- a/bot/resources/easter/april_fools_vids.json +++ b/bot/resources/easter/april_fools_vids.json @@ -116,6 +116,18 @@ "title": "Introducing Gmail Motion", "link": "https://youtu.be/Bu927_ul_X0" } + { + "title": "Introducing GeForce GTX G-Assist", + "link": "https://youtu.be/smM-Wdk2RLQ" + } + { + "title": "The Hovering Mouse - Project McFly | Razer", + "link": "https://youtu.be/IlCx5gjAmqI" + } + { + "title": "Be the Machine | Project Venom v2", + "link": "https://youtu.be/j8UJE7DoyJ8" + } ] } -- cgit v1.2.3 From 73970e6ba6909bf7ab5023377585ee12cdc77b97 Mon Sep 17 00:00:00 2001 From: Xithrius Date: Sun, 28 Mar 2021 14:45:12 -0700 Subject: Added more topics. --- bot/resources/evergreen/py_topics.yaml | 2 +- bot/resources/evergreen/starter.yaml | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/bot/resources/evergreen/py_topics.yaml b/bot/resources/evergreen/py_topics.yaml index f3b2eaa3..7d5f7cb0 100644 --- a/bot/resources/evergreen/py_topics.yaml +++ b/bot/resources/evergreen/py_topics.yaml @@ -69,7 +69,7 @@ # game-development 660625198390837248: - - + - What is your favorite game mechanic? # microcontrollers 545603026732318730: diff --git a/bot/resources/evergreen/starter.yaml b/bot/resources/evergreen/starter.yaml index 949220f9..4fec6a10 100644 --- a/bot/resources/evergreen/starter.yaml +++ b/bot/resources/evergreen/starter.yaml @@ -31,3 +31,22 @@ - What is your favorite TV show? - What is your favorite media genre? - How many years have you spent coding? +- What book do you highly recommend everyone to read? +- What websites do you use daily to keep yourself up to date with the industry? +- What made you want to join this Discord server? +- How are you? +- What is the best advice you have ever gotten in regards to programming/software? +- What is the most satisfying thing you've done in your life? +- Who is your favorite music composer/producer/singer? +- What is your favorite song? +- What is your favorite video game? +- What are your hobbies other than programming? +- Who is your favorite Writer? +- What is your favorite movie? +- What is your favorite sport? +- What is your favorite fruit? +- What is your favorite juice? +- What is the best scenery you've ever seen? +- What artistic talents do you have? +- What is the tallest building you've entered? +- What is the oldest computer you've ever used? -- cgit v1.2.3 From ab126639380b337493606bc6c90acb5046e9f76e Mon Sep 17 00:00:00 2001 From: Boris Muratov <8bee278@gmail.com> Date: Mon, 29 Mar 2021 01:00:05 +0300 Subject: Add more game dev topics --- bot/resources/evergreen/py_topics.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bot/resources/evergreen/py_topics.yaml b/bot/resources/evergreen/py_topics.yaml index 7d5f7cb0..6b7e0206 100644 --- a/bot/resources/evergreen/py_topics.yaml +++ b/bot/resources/evergreen/py_topics.yaml @@ -70,6 +70,10 @@ # game-development 660625198390837248: - What is your favorite game mechanic? + - What is your favorite framework and why? + - What games do you know that were written in Python? + - What books or tutorials would you recommend for game-development beginners? + - What made you start developing games? # microcontrollers 545603026732318730: -- cgit v1.2.3 From 4bf63f11929a22ffbb9d8859b76ed5437b0a4f13 Mon Sep 17 00:00:00 2001 From: Matteo Bertucci Date: Tue, 30 Mar 2021 16:51:29 +0200 Subject: Add missing commas to april_fools_vids.json #639 left the json file in a broken state, not letting the bot start. --- bot/resources/easter/april_fools_vids.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bot/resources/easter/april_fools_vids.json b/bot/resources/easter/april_fools_vids.json index d029ff86..b2cbd07b 100644 --- a/bot/resources/easter/april_fools_vids.json +++ b/bot/resources/easter/april_fools_vids.json @@ -115,15 +115,15 @@ { "title": "Introducing Gmail Motion", "link": "https://youtu.be/Bu927_ul_X0" - } + }, { "title": "Introducing GeForce GTX G-Assist", "link": "https://youtu.be/smM-Wdk2RLQ" - } + }, { "title": "The Hovering Mouse - Project McFly | Razer", "link": "https://youtu.be/IlCx5gjAmqI" - } + }, { "title": "Be the Machine | Project Venom v2", "link": "https://youtu.be/j8UJE7DoyJ8" -- cgit v1.2.3