From fafe8ba9479315dae16aa742dd7c0f787a353358 Mon Sep 17 00:00:00 2001 From: DMFriends <86751519+DMFriends@users.noreply.github.com> Date: Fri, 20 May 2022 18:11:25 -0400 Subject: Add topics for `#media-processing` channel (#1054) Add topics for `#media-processing` channel Co-authored-by: mina <75038675+minalike@users.noreply.github.com> --- bot/resources/utilities/py_topics.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bot/resources/utilities/py_topics.yaml b/bot/resources/utilities/py_topics.yaml index 92fc0b73..4527e8de 100644 --- a/bot/resources/utilities/py_topics.yaml +++ b/bot/resources/utilities/py_topics.yaml @@ -109,6 +109,17 @@ - What books or tutorials would you recommend for game-development beginners? - What made you start developing games? +# media-processing +971142229462777926: + - Where do you start with media processing? What is a good beginner project for first-timers in media processing? + - What are some ways you could manipulate media using Python? + - What is your favorite algorithm for manipulating media with Python? + - What is the most surprising result you have gotten after manipulating media with Python? + - What is the worst outcome you have gotten after manipulating media with Python? + - What is your most advanced media processing related achievement? + - Do you know any cool tricks or optimizations for manipulating media with Python? + - Can a computer truly generate and/or understand art? + # microcontrollers 545603026732318730: - What is your favorite version of the Raspberry Pi? -- cgit v1.2.3 From 67b2049d12888c1f5bf4ce0d64655d469843b8e0 Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Thu, 26 May 2022 09:57:56 +0100 Subject: Allow latex command in data science and ai channel --- bot/constants.py | 1 + bot/exts/fun/latex.py | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/bot/constants.py b/bot/constants.py index da81a089..bc0b5931 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -112,6 +112,7 @@ class Channels(NamedTuple): bot_commands = 267659945086812160 community_meta = 267659945086812160 organisation = 551789653284356126 + data_science_and_ai = 366673247892275221 devlog = int(environ.get("CHANNEL_DEVLOG", 622895325144940554)) dev_contrib = 635950537262759947 mod_meta = 775412552795947058 diff --git a/bot/exts/fun/latex.py b/bot/exts/fun/latex.py index d43ec8c4..f0f2f8c0 100644 --- a/bot/exts/fun/latex.py +++ b/bot/exts/fun/latex.py @@ -10,6 +10,8 @@ from PIL import Image from discord.ext import commands from bot.bot import Bot +from bot.constants import Channels, WHITELISTED_CHANNELS +from bot.utils.decorators import whitelist_override FORMATTED_CODE_REGEX = re.compile( r"(?P(?P```)|``?)" # code delimiter: 1-3 backticks; (?P=block) only matches if it's a block @@ -31,6 +33,10 @@ TEMPLATE = string.Template(Path("bot/resources/fun/latex_template.txt").read_tex PAD = 10 +LATEX_ALLOWED_CHANNNELS = WHITELISTED_CHANNELS + ( + Channels.data_science_and_ai, +) + def _prepare_input(text: str) -> str: """Extract latex from a codeblock, if it is in one.""" @@ -97,6 +103,7 @@ class Latex(commands.Cog): @commands.command() @commands.max_concurrency(1, commands.BucketType.guild, wait=True) + @whitelist_override(channels=LATEX_ALLOWED_CHANNNELS) async def latex(self, ctx: commands.Context, *, query: str) -> None: """Renders the text in latex and sends the image.""" query = _prepare_input(query) -- cgit v1.2.3