From 9524620ddbb7d3e707258e1ba3b84b23b5e3b54a Mon Sep 17 00:00:00 2001 From: Dillon Runke <44979306+Kronifer@users.noreply.github.com> Date: Tue, 20 Apr 2021 11:12:17 -0500 Subject: Add Catify command (#694) Co-authored-by: Joe Banks Co-authored-by: hypergamer80 <79152594+hypergamer80@users.noreply.github.com> --- bot/exts/evergreen/catify.py | 78 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 bot/exts/evergreen/catify.py (limited to 'bot/exts/evergreen/catify.py') diff --git a/bot/exts/evergreen/catify.py b/bot/exts/evergreen/catify.py new file mode 100644 index 00000000..a0121403 --- /dev/null +++ b/bot/exts/evergreen/catify.py @@ -0,0 +1,78 @@ +import random +from typing import Optional + +from discord import AllowedMentions, Embed +from discord.ext import commands + +from bot.constants import Cats, Colours, NEGATIVE_REPLIES + + +class Catify(commands.Cog): + """Cog for the catify command.""" + + def __init__(self, bot: commands.Bot): + self.bot = bot + + @commands.command(aliases=["ᓚᘏᗢify", "ᓚᘏᗢ"]) + async def catify(self, ctx: commands.Context, *, text: Optional[str]) -> None: + """ + Convert the provided text into a cat themed sentence by interspercing cats throughout text. + + If no text is given then the users nickname is edited. + """ + if not text: + display_name = ctx.author.display_name + + if len(display_name) > 26: + embed = Embed( + title=random.choice(NEGATIVE_REPLIES), + description="Your nickname is too long to be catified! Please change it to be under 26 characters.", + color=Colours.soft_red + ) + await ctx.send(embed=embed) + return + + else: + display_name += f" | {random.choice(Cats.cats)}" + await ctx.send(f"Your catified username is: `{display_name}`") + await ctx.author.edit(nick=display_name) + else: + if len(text) >= 1500: + embed = Embed( + title=random.choice(NEGATIVE_REPLIES), + description="Submitted text was too large! Please submit something under 1500 characters.", + color=Colours.soft_red + ) + await ctx.send(embed=embed) + return + + string_list = text.split() + for index, name in enumerate(string_list): + if "cat" in name: + if random.randint(0, 5) == 5: + string_list[index] = string_list[index].replace("cat", f"**{random.choice(Cats.cats)}**") + else: + string_list[index] = string_list[index].replace("cat", random.choice(Cats.cats)) + for element in Cats.cats: + if element in name: + string_list[index] = string_list[index].replace(element, "cat") + + string_len = len(string_list) // 3 or len(string_list) + + for _ in range(random.randint(1, string_len)): + # insert cat at random index + if random.randint(0, 5) == 5: + string_list.insert(random.randint(0, len(string_list)), f"**{random.choice(Cats.cats)}**") + else: + string_list.insert(random.randint(0, len(string_list)), random.choice(Cats.cats)) + + text = " ".join(string_list) + await ctx.send( + f">>> {text}", + allowed_mentions=AllowedMentions.none() + ) + + +def setup(bot: commands.Bot) -> None: + """Loads the catify cog.""" + bot.add_cog(Catify(bot)) -- cgit v1.2.3 From dc7923a78a4020a4020c42a392ff38bf3f5c35f3 Mon Sep 17 00:00:00 2001 From: ToxicKidz <78174417+ToxicKidz@users.noreply.github.com> Date: Tue, 20 Apr 2021 12:30:27 -0400 Subject: chore: Fix UnboundLocalError and discord.ForbiddenErrors in the catify command --- bot/exts/evergreen/catify.py | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) (limited to 'bot/exts/evergreen/catify.py') diff --git a/bot/exts/evergreen/catify.py b/bot/exts/evergreen/catify.py index a0121403..c409ce6c 100644 --- a/bot/exts/evergreen/catify.py +++ b/bot/exts/evergreen/catify.py @@ -1,7 +1,8 @@ import random +from contextlib import suppress from typing import Optional -from discord import AllowedMentions, Embed +from discord import AllowedMentions, Embed, Forbidden from discord.ext import commands from bot.constants import Cats, Colours, NEGATIVE_REPLIES @@ -34,8 +35,11 @@ class Catify(commands.Cog): else: display_name += f" | {random.choice(Cats.cats)}" + await ctx.send(f"Your catified username is: `{display_name}`") - await ctx.author.edit(nick=display_name) + + with suppress(Forbidden): + await ctx.author.edit(nick=display_name) else: if len(text) >= 1500: embed = Embed( @@ -50,27 +54,27 @@ class Catify(commands.Cog): for index, name in enumerate(string_list): if "cat" in name: if random.randint(0, 5) == 5: - string_list[index] = string_list[index].replace("cat", f"**{random.choice(Cats.cats)}**") + string_list[index] = name.replace("cat", f"**{random.choice(Cats.cats)}**") else: - string_list[index] = string_list[index].replace("cat", random.choice(Cats.cats)) + string_list[index] = name.replace("cat", random.choice(Cats.cats)) for element in Cats.cats: if element in name: - string_list[index] = string_list[index].replace(element, "cat") + string_list[index] = name.replace(element, "cat") - string_len = len(string_list) // 3 or len(string_list) + string_len = len(string_list) // 3 or len(string_list) - for _ in range(random.randint(1, string_len)): - # insert cat at random index - if random.randint(0, 5) == 5: - string_list.insert(random.randint(0, len(string_list)), f"**{random.choice(Cats.cats)}**") - else: - string_list.insert(random.randint(0, len(string_list)), random.choice(Cats.cats)) + for _ in range(random.randint(1, string_len)): + # insert cat at random index + if random.randint(0, 5) == 5: + string_list.insert(random.randint(0, len(string_list)), f"**{random.choice(Cats.cats)}**") + else: + string_list.insert(random.randint(0, len(string_list)), random.choice(Cats.cats)) - text = " ".join(string_list) - await ctx.send( - f">>> {text}", - allowed_mentions=AllowedMentions.none() - ) + text = " ".join(string_list) + await ctx.send( + f">>> {text}", + allowed_mentions=AllowedMentions.none() + ) def setup(bot: commands.Bot) -> None: -- cgit v1.2.3 From 3477069a3a2e0b5e4030602afa4a4c0e7411a7e1 Mon Sep 17 00:00:00 2001 From: ToxicKidz <78174417+ToxicKidz@users.noreply.github.com> Date: Tue, 20 Apr 2021 12:59:46 -0400 Subject: chore: lower the input to fine more cats --- bot/exts/evergreen/catify.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'bot/exts/evergreen/catify.py') diff --git a/bot/exts/evergreen/catify.py b/bot/exts/evergreen/catify.py index c409ce6c..262c75bd 100644 --- a/bot/exts/evergreen/catify.py +++ b/bot/exts/evergreen/catify.py @@ -52,11 +52,12 @@ class Catify(commands.Cog): string_list = text.split() for index, name in enumerate(string_list): - if "cat" in name: + name = name.lower() + if "cat" in text: if random.randint(0, 5) == 5: - string_list[index] = name.replace("cat", f"**{random.choice(Cats.cats)}**") + string_list[index] = text.replace("cat", f"**{random.choice(Cats.cats)}**") else: - string_list[index] = name.replace("cat", random.choice(Cats.cats)) + string_list[index] = text.replace("cat", random.choice(Cats.cats)) for element in Cats.cats: if element in name: string_list[index] = name.replace(element, "cat") -- cgit v1.2.3 From 5f889e4d3f0712c0005dbbc7c3ee820cc786ec30 Mon Sep 17 00:00:00 2001 From: ToxicKidz <78174417+ToxicKidz@users.noreply.github.com> Date: Tue, 20 Apr 2021 13:05:03 -0400 Subject: fix: Use name.replace not text.replace --- bot/exts/evergreen/catify.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bot/exts/evergreen/catify.py') diff --git a/bot/exts/evergreen/catify.py b/bot/exts/evergreen/catify.py index 262c75bd..88c63202 100644 --- a/bot/exts/evergreen/catify.py +++ b/bot/exts/evergreen/catify.py @@ -53,11 +53,11 @@ class Catify(commands.Cog): string_list = text.split() for index, name in enumerate(string_list): name = name.lower() - if "cat" in text: + if "cat" in name: if random.randint(0, 5) == 5: - string_list[index] = text.replace("cat", f"**{random.choice(Cats.cats)}**") + string_list[index] = name.replace("cat", f"**{random.choice(Cats.cats)}**") else: - string_list[index] = text.replace("cat", random.choice(Cats.cats)) + string_list[index] = name.replace("cat", random.choice(Cats.cats)) for element in Cats.cats: if element in name: string_list[index] = name.replace(element, "cat") -- cgit v1.2.3 From daf7dc79753d0d4482f58ddcad0ee2a7f7a244c1 Mon Sep 17 00:00:00 2001 From: ToxicKidz <78174417+ToxicKidz@users.noreply.github.com> Date: Tue, 20 Apr 2021 16:13:57 -0400 Subject: chore: use 'nickname' and 'display name' in the right places and use allowed_mentions --- bot/exts/evergreen/catify.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'bot/exts/evergreen/catify.py') diff --git a/bot/exts/evergreen/catify.py b/bot/exts/evergreen/catify.py index 88c63202..ae8d54b6 100644 --- a/bot/exts/evergreen/catify.py +++ b/bot/exts/evergreen/catify.py @@ -27,7 +27,10 @@ class Catify(commands.Cog): if len(display_name) > 26: embed = Embed( title=random.choice(NEGATIVE_REPLIES), - description="Your nickname is too long to be catified! Please change it to be under 26 characters.", + description=( + "Your display name is too long to be catified! " + "Please change it to be under 26 characters." + ), color=Colours.soft_red ) await ctx.send(embed=embed) @@ -36,7 +39,7 @@ class Catify(commands.Cog): else: display_name += f" | {random.choice(Cats.cats)}" - await ctx.send(f"Your catified username is: `{display_name}`") + await ctx.send(f"Your catified nickname is: `{display_name}`", allowed_mentions=AllowedMentions.none()) with suppress(Forbidden): await ctx.author.edit(nick=display_name) -- cgit v1.2.3 From 9e03064e9c116b0dd2bcc65b149b7ac9ee389ff3 Mon Sep 17 00:00:00 2001 From: Hassan Abouelela Date: Fri, 23 Apr 2021 02:59:30 +0300 Subject: Suppresses Links In Commands Suppresses links in certain commands that can echo back user input. Signed-off-by: Hassan Abouelela --- bot/exts/easter/egg_decorating.py | 4 +++- bot/exts/evergreen/catify.py | 3 ++- bot/exts/evergreen/fun.py | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) (limited to 'bot/exts/evergreen/catify.py') diff --git a/bot/exts/easter/egg_decorating.py b/bot/exts/easter/egg_decorating.py index b18e6636..a847388d 100644 --- a/bot/exts/easter/egg_decorating.py +++ b/bot/exts/easter/egg_decorating.py @@ -10,6 +10,8 @@ import discord from PIL import Image from discord.ext import commands +from bot.utils import helpers + log = logging.getLogger(__name__) with open(Path("bot/resources/evergreen/html_colours.json"), encoding="utf8") as f: @@ -65,7 +67,7 @@ class EggDecorating(commands.Cog): if value: colours[idx] = discord.Colour(value) else: - invalid.append(colour) + invalid.append(helpers.suppress_links(colour)) if len(invalid) > 1: return await ctx.send(f"Sorry, I don't know these colours: {' '.join(invalid)}") diff --git a/bot/exts/evergreen/catify.py b/bot/exts/evergreen/catify.py index ae8d54b6..d8a7442d 100644 --- a/bot/exts/evergreen/catify.py +++ b/bot/exts/evergreen/catify.py @@ -6,6 +6,7 @@ from discord import AllowedMentions, Embed, Forbidden from discord.ext import commands from bot.constants import Cats, Colours, NEGATIVE_REPLIES +from bot.utils import helpers class Catify(commands.Cog): @@ -74,7 +75,7 @@ class Catify(commands.Cog): else: string_list.insert(random.randint(0, len(string_list)), random.choice(Cats.cats)) - text = " ".join(string_list) + text = helpers.suppress_links(" ".join(string_list)) await ctx.send( f">>> {text}", allowed_mentions=AllowedMentions.none() diff --git a/bot/exts/evergreen/fun.py b/bot/exts/evergreen/fun.py index 101725da..7152d0cb 100644 --- a/bot/exts/evergreen/fun.py +++ b/bot/exts/evergreen/fun.py @@ -11,6 +11,7 @@ from discord.ext.commands import BadArgument, Bot, Cog, Context, MessageConverte from bot import utils from bot.constants import Client, Colours, Emojis +from bot.utils import helpers log = logging.getLogger(__name__) @@ -83,6 +84,7 @@ class Fun(Cog): if embed is not None: embed = Fun._convert_embed(conversion_func, embed) converted_text = conversion_func(text) + converted_text = helpers.suppress_links(converted_text) # Don't put >>> if only embed present if converted_text: converted_text = f">>> {converted_text.lstrip('> ')}" @@ -101,6 +103,7 @@ class Fun(Cog): if embed is not None: embed = Fun._convert_embed(conversion_func, embed) converted_text = conversion_func(text) + converted_text = helpers.suppress_links(converted_text) # Don't put >>> if only embed present if converted_text: converted_text = f">>> {converted_text.lstrip('> ')}" -- cgit v1.2.3 From 6d31315fa72ca9e6ccd7553e78548fed6e5e4829 Mon Sep 17 00:00:00 2001 From: ToxicKidz <78174417+ToxicKidz@users.noreply.github.com> Date: Tue, 4 May 2021 15:44:31 -0400 Subject: fix: Pass bot only when __init__ is defined --- bot/exts/easter/bunny_name_generator.py | 2 +- bot/exts/easter/egg_decorating.py | 2 +- bot/exts/evergreen/avatar_modification/avatar_modify.py | 5 +++-- bot/exts/evergreen/bookmark.py | 2 +- bot/exts/evergreen/catify.py | 8 +++----- bot/exts/evergreen/conversationstarters.py | 2 +- bot/exts/evergreen/emoji.py | 2 +- bot/exts/evergreen/error_handler.py | 2 +- bot/exts/evergreen/latex.py | 2 +- bot/exts/evergreen/pythonfacts.py | 2 +- bot/exts/evergreen/snakes/__init__.py | 5 ++--- bot/exts/evergreen/source.py | 2 +- bot/exts/evergreen/speedrun.py | 2 +- bot/exts/evergreen/timed.py | 2 +- bot/exts/evergreen/uptime.py | 2 +- bot/exts/halloween/timeleft.py | 5 +---- bot/exts/valentines/be_my_valentine.py | 4 ++-- bot/exts/valentines/lovecalculator.py | 2 +- bot/exts/valentines/movie_generator.py | 4 ++-- bot/exts/valentines/myvalenstate.py | 7 ++----- bot/exts/valentines/pickuplines.py | 2 +- bot/exts/valentines/savethedate.py | 2 +- bot/exts/valentines/valentine_zodiac.py | 2 +- bot/exts/valentines/whoisvalentine.py | 2 +- 24 files changed, 32 insertions(+), 40 deletions(-) (limited to 'bot/exts/evergreen/catify.py') diff --git a/bot/exts/easter/bunny_name_generator.py b/bot/exts/easter/bunny_name_generator.py index 23f85226..19a0b0f6 100644 --- a/bot/exts/easter/bunny_name_generator.py +++ b/bot/exts/easter/bunny_name_generator.py @@ -88,4 +88,4 @@ class BunnyNameGenerator(commands.Cog): def setup(bot: Bot) -> None: """Load the Bunny Name Generator Cog.""" - bot.add_cog(BunnyNameGenerator(bot)) + bot.add_cog(BunnyNameGenerator()) diff --git a/bot/exts/easter/egg_decorating.py b/bot/exts/easter/egg_decorating.py index 1432fa31..3744989d 100644 --- a/bot/exts/easter/egg_decorating.py +++ b/bot/exts/easter/egg_decorating.py @@ -118,4 +118,4 @@ class EggDecorating(commands.Cog): def setup(bot: Bot) -> None: """Load the Egg decorating Cog.""" - bot.add_cog(EggDecorating(bot)) + bot.add_cog(EggDecorating()) diff --git a/bot/exts/evergreen/avatar_modification/avatar_modify.py b/bot/exts/evergreen/avatar_modification/avatar_modify.py index 0baee8b2..2304e459 100644 --- a/bot/exts/evergreen/avatar_modification/avatar_modify.py +++ b/bot/exts/evergreen/avatar_modification/avatar_modify.py @@ -11,6 +11,7 @@ from aiohttp import client_exceptions from discord.ext import commands from discord.ext.commands.errors import BadArgument +from bot.bot import Bot from bot.constants import Client, Colours, Emojis from bot.exts.evergreen.avatar_modification._effects import PfpEffects from bot.utils.extensions import invoke_help_command @@ -58,7 +59,7 @@ def file_safe_name(effect: str, display_name: str) -> str: class AvatarModify(commands.Cog): """Various commands for users to apply affects to their own avatars.""" - def __init__(self, bot: commands.Bot) -> None: + def __init__(self, bot: Bot) -> None: self.bot = bot async def _fetch_member(self, member_id: int) -> t.Optional[discord.Member]: @@ -309,6 +310,6 @@ class AvatarModify(commands.Cog): await ctx.send(file=file, embed=embed) -def setup(bot: commands.Bot) -> None: +def setup(bot: Bot) -> None: """Load the PfpModify cog.""" bot.add_cog(AvatarModify(bot)) diff --git a/bot/exts/evergreen/bookmark.py b/bot/exts/evergreen/bookmark.py index 6a272784..f0fad0ea 100644 --- a/bot/exts/evergreen/bookmark.py +++ b/bot/exts/evergreen/bookmark.py @@ -60,4 +60,4 @@ class Bookmark(commands.Cog): def setup(bot: Bot) -> None: """Load the Bookmark cog.""" - bot.add_cog(Bookmark(bot)) + bot.add_cog(Bookmark()) diff --git a/bot/exts/evergreen/catify.py b/bot/exts/evergreen/catify.py index d8a7442d..b4ae4a25 100644 --- a/bot/exts/evergreen/catify.py +++ b/bot/exts/evergreen/catify.py @@ -5,6 +5,7 @@ from typing import Optional from discord import AllowedMentions, Embed, Forbidden from discord.ext import commands +from bot.bot import Bot from bot.constants import Cats, Colours, NEGATIVE_REPLIES from bot.utils import helpers @@ -12,9 +13,6 @@ from bot.utils import helpers class Catify(commands.Cog): """Cog for the catify command.""" - def __init__(self, bot: commands.Bot): - self.bot = bot - @commands.command(aliases=["ᓚᘏᗢify", "ᓚᘏᗢ"]) async def catify(self, ctx: commands.Context, *, text: Optional[str]) -> None: """ @@ -82,6 +80,6 @@ class Catify(commands.Cog): ) -def setup(bot: commands.Bot) -> None: +def setup(bot: Bot) -> None: """Loads the catify cog.""" - bot.add_cog(Catify(bot)) + bot.add_cog(Catify()) diff --git a/bot/exts/evergreen/conversationstarters.py b/bot/exts/evergreen/conversationstarters.py index 4fe8c47c..fdc4467a 100644 --- a/bot/exts/evergreen/conversationstarters.py +++ b/bot/exts/evergreen/conversationstarters.py @@ -66,4 +66,4 @@ class ConvoStarters(commands.Cog): def setup(bot: Bot) -> None: """Load the ConvoStarters cog.""" - bot.add_cog(ConvoStarters(bot)) + bot.add_cog(ConvoStarters()) diff --git a/bot/exts/evergreen/emoji.py b/bot/exts/evergreen/emoji.py index e7452a15..11615214 100644 --- a/bot/exts/evergreen/emoji.py +++ b/bot/exts/evergreen/emoji.py @@ -120,4 +120,4 @@ class Emojis(commands.Cog): def setup(bot: Bot) -> None: """Load the Emojis cog.""" - bot.add_cog(Emojis(bot)) + bot.add_cog(Emojis()) diff --git a/bot/exts/evergreen/error_handler.py b/bot/exts/evergreen/error_handler.py index 5cd8d28d..62529f52 100644 --- a/bot/exts/evergreen/error_handler.py +++ b/bot/exts/evergreen/error_handler.py @@ -135,4 +135,4 @@ class CommandErrorHandler(commands.Cog): def setup(bot: Bot) -> None: """Load the ErrorHandler cog.""" - bot.add_cog(CommandErrorHandler(bot)) + bot.add_cog(CommandErrorHandler()) diff --git a/bot/exts/evergreen/latex.py b/bot/exts/evergreen/latex.py index 3a93907a..54d25267 100644 --- a/bot/exts/evergreen/latex.py +++ b/bot/exts/evergreen/latex.py @@ -93,4 +93,4 @@ class Latex(commands.Cog): def setup(bot: Bot) -> None: """Load the Latex Cog.""" - bot.add_cog(Latex(bot)) + bot.add_cog(Latex()) diff --git a/bot/exts/evergreen/pythonfacts.py b/bot/exts/evergreen/pythonfacts.py index 2dc4996f..c0086c20 100644 --- a/bot/exts/evergreen/pythonfacts.py +++ b/bot/exts/evergreen/pythonfacts.py @@ -28,4 +28,4 @@ class PythonFacts(commands.Cog): def setup(bot: Bot) -> None: """Load the PythonFacts Cog.""" - bot.add_cog(PythonFacts(bot)) + bot.add_cog(PythonFacts()) diff --git a/bot/exts/evergreen/snakes/__init__.py b/bot/exts/evergreen/snakes/__init__.py index bc42f0c2..049bc964 100644 --- a/bot/exts/evergreen/snakes/__init__.py +++ b/bot/exts/evergreen/snakes/__init__.py @@ -1,12 +1,11 @@ import logging -from discord.ext import commands - +from bot.bot import Bot from bot.exts.evergreen.snakes._snakes_cog import Snakes log = logging.getLogger(__name__) -def setup(bot: commands.Bot) -> None: +def setup(bot: Bot) -> None: """Snakes Cog load.""" bot.add_cog(Snakes(bot)) diff --git a/bot/exts/evergreen/source.py b/bot/exts/evergreen/source.py index 2f25e4cb..685b3111 100644 --- a/bot/exts/evergreen/source.py +++ b/bot/exts/evergreen/source.py @@ -104,4 +104,4 @@ class BotSource(commands.Cog): def setup(bot: Bot) -> None: """Load the BotSource cog.""" - bot.add_cog(BotSource(bot)) + bot.add_cog(BotSource()) diff --git a/bot/exts/evergreen/speedrun.py b/bot/exts/evergreen/speedrun.py index 110d5c13..d9820287 100644 --- a/bot/exts/evergreen/speedrun.py +++ b/bot/exts/evergreen/speedrun.py @@ -23,4 +23,4 @@ class Speedrun(commands.Cog): def setup(bot: Bot) -> None: """Load the Speedrun cog.""" - bot.add_cog(Speedrun(bot)) + bot.add_cog(Speedrun()) diff --git a/bot/exts/evergreen/timed.py b/bot/exts/evergreen/timed.py index 42a77346..491231cc 100644 --- a/bot/exts/evergreen/timed.py +++ b/bot/exts/evergreen/timed.py @@ -45,4 +45,4 @@ class TimedCommands(commands.Cog): def setup(bot: Bot) -> None: """Load the Timed cog.""" - bot.add_cog(TimedCommands(bot)) + bot.add_cog(TimedCommands()) diff --git a/bot/exts/evergreen/uptime.py b/bot/exts/evergreen/uptime.py index d2509e6f..b390e7f7 100644 --- a/bot/exts/evergreen/uptime.py +++ b/bot/exts/evergreen/uptime.py @@ -28,4 +28,4 @@ class Uptime(commands.Cog): def setup(bot: Bot) -> None: """Load the Uptime cog.""" - bot.add_cog(Uptime(bot)) + bot.add_cog(Uptime()) diff --git a/bot/exts/halloween/timeleft.py b/bot/exts/halloween/timeleft.py index f4ab9284..e80025dc 100644 --- a/bot/exts/halloween/timeleft.py +++ b/bot/exts/halloween/timeleft.py @@ -12,9 +12,6 @@ log = logging.getLogger(__name__) class TimeLeft(commands.Cog): """A Cog that tells you how long left until Hacktober is over!""" - def __init__(self, bot: Bot): - self.bot = bot - def in_hacktober(self) -> bool: """Return True if the current time is within Hacktoberfest.""" _, end, start = self.load_date() @@ -68,4 +65,4 @@ class TimeLeft(commands.Cog): def setup(bot: Bot) -> None: """Load the Time Left Cog.""" - bot.add_cog(TimeLeft(bot)) + bot.add_cog(TimeLeft()) diff --git a/bot/exts/valentines/be_my_valentine.py b/bot/exts/valentines/be_my_valentine.py index e94efda0..cf6099d2 100644 --- a/bot/exts/valentines/be_my_valentine.py +++ b/bot/exts/valentines/be_my_valentine.py @@ -21,7 +21,7 @@ HEART_EMOJIS = [":heart:", ":gift_heart:", ":revolving_hearts:", ":sparkling_hea class BeMyValentine(commands.Cog): """A cog that sends Valentines to other users!""" - def __init__(self, bot: commands.Bot): + def __init__(self, bot: Bot): self.bot = bot self.valentines = self.load_json() @@ -198,5 +198,5 @@ class BeMyValentine(commands.Cog): def setup(bot: Bot) -> None: - """Be my Valentine Cog load.""" + """Load the Be my Valentine Cog.""" bot.add_cog(BeMyValentine(bot)) diff --git a/bot/exts/valentines/lovecalculator.py b/bot/exts/valentines/lovecalculator.py index c2a5da26..e55dc128 100644 --- a/bot/exts/valentines/lovecalculator.py +++ b/bot/exts/valentines/lovecalculator.py @@ -93,5 +93,5 @@ class LoveCalculator(Cog): def setup(bot: Bot) -> None: - """Love calculator Cog load.""" + """Load the Love calculator Cog.""" bot.add_cog(LoveCalculator()) diff --git a/bot/exts/valentines/movie_generator.py b/bot/exts/valentines/movie_generator.py index 461255ff..4508c3b2 100644 --- a/bot/exts/valentines/movie_generator.py +++ b/bot/exts/valentines/movie_generator.py @@ -16,7 +16,7 @@ log = logging.getLogger(__name__) class RomanceMovieFinder(commands.Cog): """A Cog that returns a random romance movie suggestion to a user.""" - def __init__(self, bot: commands.Bot): + def __init__(self, bot: Bot): self.bot = bot @commands.command(name="romancemovie") @@ -62,5 +62,5 @@ class RomanceMovieFinder(commands.Cog): def setup(bot: Bot) -> None: - """Romance movie Cog load.""" + """Load the Romance movie Cog.""" bot.add_cog(RomanceMovieFinder(bot)) diff --git a/bot/exts/valentines/myvalenstate.py b/bot/exts/valentines/myvalenstate.py index 7a0f8318..1c67984b 100644 --- a/bot/exts/valentines/myvalenstate.py +++ b/bot/exts/valentines/myvalenstate.py @@ -19,9 +19,6 @@ with open(Path("bot/resources/valentines/valenstates.json"), "r", encoding="utf8 class MyValenstate(commands.Cog): """A Cog to find your most likely Valentine's vacation destination.""" - def __init__(self, bot: commands.Bot): - self.bot = bot - def levenshtein(self, source: str, goal: str) -> int: """Calculates the Levenshtein Distance between source and goal.""" if len(source) < len(goal): @@ -83,5 +80,5 @@ class MyValenstate(commands.Cog): def setup(bot: Bot) -> None: - """Valenstate Cog load.""" - bot.add_cog(MyValenstate(bot)) + """Load the Valenstate Cog.""" + bot.add_cog(MyValenstate()) diff --git a/bot/exts/valentines/pickuplines.py b/bot/exts/valentines/pickuplines.py index 216ee13b..909169e6 100644 --- a/bot/exts/valentines/pickuplines.py +++ b/bot/exts/valentines/pickuplines.py @@ -38,5 +38,5 @@ class PickupLine(commands.Cog): def setup(bot: Bot) -> None: - """Pickup lines Cog load.""" + """Load the Pickup lines Cog.""" bot.add_cog(PickupLine()) diff --git a/bot/exts/valentines/savethedate.py b/bot/exts/valentines/savethedate.py index ed2d2c5f..cc16f5c9 100644 --- a/bot/exts/valentines/savethedate.py +++ b/bot/exts/valentines/savethedate.py @@ -35,5 +35,5 @@ class SaveTheDate(commands.Cog): def setup(bot: Bot) -> None: - """Save the date Cog Load.""" + """Load the Save the date Cog.""" bot.add_cog(SaveTheDate()) diff --git a/bot/exts/valentines/valentine_zodiac.py b/bot/exts/valentines/valentine_zodiac.py index 72fd93fe..a444a355 100644 --- a/bot/exts/valentines/valentine_zodiac.py +++ b/bot/exts/valentines/valentine_zodiac.py @@ -142,5 +142,5 @@ class ValentineZodiac(commands.Cog): def setup(bot: Bot) -> None: - """Valentine zodiac Cog load.""" + """Load the Valentine zodiac Cog.""" bot.add_cog(ValentineZodiac()) diff --git a/bot/exts/valentines/whoisvalentine.py b/bot/exts/valentines/whoisvalentine.py index 3789fad5..3f23201f 100644 --- a/bot/exts/valentines/whoisvalentine.py +++ b/bot/exts/valentines/whoisvalentine.py @@ -46,5 +46,5 @@ class ValentineFacts(commands.Cog): def setup(bot: Bot) -> None: - """Who is Valentine Cog load.""" + """Load the Who is Valentine Cog.""" bot.add_cog(ValentineFacts()) -- cgit v1.2.3 From ccb7cd7bc4ab43e4d777093a14c921a64c884f6e Mon Sep 17 00:00:00 2001 From: ToxicKidz <78174417+ToxicKidz@users.noreply.github.com> Date: Wed, 5 May 2021 11:28:01 -0400 Subject: chore: Add a 5 second cooldown per user to .catify --- bot/exts/evergreen/catify.py | 1 + 1 file changed, 1 insertion(+) (limited to 'bot/exts/evergreen/catify.py') diff --git a/bot/exts/evergreen/catify.py b/bot/exts/evergreen/catify.py index d8a7442d..a175602f 100644 --- a/bot/exts/evergreen/catify.py +++ b/bot/exts/evergreen/catify.py @@ -16,6 +16,7 @@ class Catify(commands.Cog): self.bot = bot @commands.command(aliases=["ᓚᘏᗢify", "ᓚᘏᗢ"]) + @commands.cooldown(1, 5, commands.BucketType.user) async def catify(self, ctx: commands.Context, *, text: Optional[str]) -> None: """ Convert the provided text into a cat themed sentence by interspercing cats throughout text. -- cgit v1.2.3 From 55d472a97efea392b4eb2b198ffa6f5f5026072d Mon Sep 17 00:00:00 2001 From: ToxicKidz Date: Sat, 15 May 2021 12:53:00 -0400 Subject: chore: Make all aliases in commands tuples --- bot/exts/christmas/hanukkah_embed.py | 2 +- bot/exts/easter/earth_photos.py | 2 +- bot/exts/easter/easter_riddle.py | 2 +- bot/exts/easter/egg_decorating.py | 2 +- bot/exts/easter/egg_facts.py | 2 +- bot/exts/easter/egghead_quiz.py | 2 +- bot/exts/evergreen/battleship.py | 2 +- bot/exts/evergreen/catify.py | 2 +- bot/exts/evergreen/connect_four.py | 4 ++-- bot/exts/evergreen/game.py | 12 ++++++------ bot/exts/evergreen/movie.py | 4 ++-- bot/exts/evergreen/pythonfacts.py | 2 +- bot/exts/evergreen/recommend_game.py | 2 +- bot/exts/evergreen/space.py | 2 +- bot/exts/evergreen/timed.py | 2 +- bot/exts/evergreen/trivia_quiz.py | 2 +- bot/exts/evergreen/wikipedia.py | 2 +- bot/exts/evergreen/wonder_twins.py | 2 +- bot/exts/halloween/spookynamerate.py | 4 ++-- bot/exts/pride/drag_queen_name.py | 2 +- bot/exts/pride/pride_anthem.py | 2 +- bot/exts/pride/pride_facts.py | 2 +- bot/exts/valentines/valentine_zodiac.py | 2 +- 23 files changed, 31 insertions(+), 31 deletions(-) (limited to 'bot/exts/evergreen/catify.py') diff --git a/bot/exts/christmas/hanukkah_embed.py b/bot/exts/christmas/hanukkah_embed.py index 77ef4684..7a06b558 100644 --- a/bot/exts/christmas/hanukkah_embed.py +++ b/bot/exts/christmas/hanukkah_embed.py @@ -38,7 +38,7 @@ class HanukkahEmbed(commands.Cog): return hanukkah_dates @in_month(Month.DECEMBER) - @commands.command(name="hanukkah", aliases=["chanukah"]) + @commands.command(name="hanukkah", aliases=("chanukah",)) async def hanukkah_festival(self, ctx: commands.Context) -> None: """Tells you about the Hanukkah Festivaltime of festival, festival day, etc).""" hanukkah_dates = await self.get_hanukkah_dates() diff --git a/bot/exts/easter/earth_photos.py b/bot/exts/easter/earth_photos.py index 0e82e99a..9df4f9ca 100644 --- a/bot/exts/easter/earth_photos.py +++ b/bot/exts/easter/earth_photos.py @@ -16,7 +16,7 @@ class EarthPhotos(commands.Cog): def __init__(self, bot: Bot): self.bot = bot - @commands.command(aliases=["earth"]) + @commands.command(aliases=("earth",)) async def earth_photos(self, ctx: commands.Context) -> None: """Returns a random photo of earth, sourced from Unsplash.""" async with ctx.typing(): diff --git a/bot/exts/easter/easter_riddle.py b/bot/exts/easter/easter_riddle.py index 01b956f1..a87f93d1 100644 --- a/bot/exts/easter/easter_riddle.py +++ b/bot/exts/easter/easter_riddle.py @@ -26,7 +26,7 @@ class EasterRiddle(commands.Cog): self.correct = "" self.current_channel = None - @commands.command(aliases=["riddlemethis", "riddleme"]) + @commands.command(aliases=("riddlemethis", "riddleme")) async def riddle(self, ctx: commands.Context) -> None: """ Gives a random riddle, then provides 2 hints at certain intervals before revealing the answer. diff --git a/bot/exts/easter/egg_decorating.py b/bot/exts/easter/egg_decorating.py index 7448f702..d4b27b20 100644 --- a/bot/exts/easter/egg_decorating.py +++ b/bot/exts/easter/egg_decorating.py @@ -41,7 +41,7 @@ class EggDecorating(commands.Cog): return int(XKCD_COLOURS[colour], 16) return None - @commands.command(aliases=["decorateegg"]) + @commands.command(aliases=("decorateegg",)) async def eggdecorate( self, ctx: commands.Context, *colours: Union[discord.Colour, str] ) -> Union[Image.Image, discord.Message]: diff --git a/bot/exts/easter/egg_facts.py b/bot/exts/easter/egg_facts.py index c1c43f80..d60032f0 100644 --- a/bot/exts/easter/egg_facts.py +++ b/bot/exts/easter/egg_facts.py @@ -40,7 +40,7 @@ class EasterFacts(commands.Cog): channel = self.bot.get_channel(Channels.community_bot_commands) await channel.send(embed=self.make_embed()) - @commands.command(name="eggfact", aliases=["fact"]) + @commands.command(name="eggfact", aliases=("fact",)) async def easter_facts(self, ctx: commands.Context) -> None: """Get easter egg facts.""" embed = self.make_embed() diff --git a/bot/exts/easter/egghead_quiz.py b/bot/exts/easter/egghead_quiz.py index 4b67310f..7c4960cd 100644 --- a/bot/exts/easter/egghead_quiz.py +++ b/bot/exts/easter/egghead_quiz.py @@ -34,7 +34,7 @@ class EggheadQuiz(commands.Cog): def __init__(self) -> None: self.quiz_messages = {} - @commands.command(aliases=["eggheadquiz", "easterquiz"]) + @commands.command(aliases=("eggheadquiz", "easterquiz")) async def eggquiz(self, ctx: commands.Context) -> None: """ Gives a random quiz question, waits 30 seconds and then outputs the answer. diff --git a/bot/exts/evergreen/battleship.py b/bot/exts/evergreen/battleship.py index d4584ae8..27c50bdb 100644 --- a/bot/exts/evergreen/battleship.py +++ b/bot/exts/evergreen/battleship.py @@ -434,7 +434,7 @@ class Battleship(commands.Cog): self.games.remove(game) raise - @battleship.command(name="ships", aliases=["boats"]) + @battleship.command(name="ships", aliases=("boats",)) async def battleship_ships(self, ctx: commands.Context) -> None: """Lists the ships that are found on the battleship grid.""" embed = discord.Embed(colour=Colours.blue) diff --git a/bot/exts/evergreen/catify.py b/bot/exts/evergreen/catify.py index 3182f69e..32dfae09 100644 --- a/bot/exts/evergreen/catify.py +++ b/bot/exts/evergreen/catify.py @@ -13,7 +13,7 @@ from bot.utils import helpers class Catify(commands.Cog): """Cog for the catify command.""" - @commands.command(aliases=["ᓚᘏᗢify", "ᓚᘏᗢ"]) + @commands.command(aliases=("ᓚᘏᗢify", "ᓚᘏᗢ")) @commands.cooldown(1, 5, commands.BucketType.user) async def catify(self, ctx: commands.Context, *, text: Optional[str]) -> None: """ diff --git a/bot/exts/evergreen/connect_four.py b/bot/exts/evergreen/connect_four.py index 7a39d442..5c82ffee 100644 --- a/bot/exts/evergreen/connect_four.py +++ b/bot/exts/evergreen/connect_four.py @@ -365,7 +365,7 @@ class ConnectFour(commands.Cog): @guild_only() @commands.group( invoke_without_command=True, - aliases=["4inarow", "connect4", "connectfour", "c4"], + aliases=("4inarow", "connect4", "connectfour", "c4"), case_insensitive=True ) async def connect_four( @@ -428,7 +428,7 @@ class ConnectFour(commands.Cog): await self._play_game(ctx, user, board_size, str(emoji1), str(emoji2)) @guild_only() - @connect_four.command(aliases=["bot", "computer", "cpu"]) + @connect_four.command(aliases=("bot", "computer", "cpu")) async def ai( self, ctx: commands.Context, diff --git a/bot/exts/evergreen/game.py b/bot/exts/evergreen/game.py index 43f64be7..32fe9263 100644 --- a/bot/exts/evergreen/game.py +++ b/bot/exts/evergreen/game.py @@ -224,7 +224,7 @@ class Games(Cog): else: self.genres[genre_name] = genre - @group(name="games", aliases=["game"], invoke_without_command=True) + @group(name="games", aliases=("game",), invoke_without_command=True) async def games(self, ctx: Context, amount: Optional[int] = 5, *, genre: Optional[str]) -> None: """ Get random game(s) by genre from IGDB. Use .games genres command to get all available genres. @@ -277,7 +277,7 @@ class Games(Cog): await ImagePaginator.paginate(pages, ctx, Embed(title=f"Random {genre.title()} Games")) - @games.command(name="top", aliases=["t"]) + @games.command(name="top", aliases=("t",)) async def top(self, ctx: Context, amount: int = 10) -> None: """ Get current Top games in IGDB. @@ -294,19 +294,19 @@ class Games(Cog): pages = [await self.create_page(game) for game in games] await ImagePaginator.paginate(pages, ctx, Embed(title=f"Top {amount} Games")) - @games.command(name="genres", aliases=["genre", "g"]) + @games.command(name="genres", aliases=("genre", "g")) async def genres(self, ctx: Context) -> None: """Get all available genres.""" await ctx.send(f"Currently available genres: {', '.join(f'`{genre}`' for genre in self.genres)}") - @games.command(name="search", aliases=["s"]) + @games.command(name="search", aliases=("s",)) async def search(self, ctx: Context, *, search_term: str) -> None: """Find games by name.""" lines = await self.search_games(search_term) await LinePaginator.paginate(lines, ctx, Embed(title=f"Game Search Results: {search_term}"), empty=False) - @games.command(name="company", aliases=["companies"]) + @games.command(name="company", aliases=("companies",)) async def company(self, ctx: Context, amount: int = 5) -> None: """ Get random Game Companies companies from IGDB API. @@ -325,7 +325,7 @@ class Games(Cog): await ImagePaginator.paginate(pages, ctx, Embed(title="Random Game Companies")) @with_role(*STAFF_ROLES) - @games.command(name="refresh", aliases=["r"]) + @games.command(name="refresh", aliases=("r",)) async def refresh_genres_command(self, ctx: Context) -> None: """Refresh .games command genres.""" try: diff --git a/bot/exts/evergreen/movie.py b/bot/exts/evergreen/movie.py index ff23df4c..10638aea 100644 --- a/bot/exts/evergreen/movie.py +++ b/bot/exts/evergreen/movie.py @@ -53,7 +53,7 @@ class Movie(Cog): def __init__(self, bot: Bot): self.http_session: ClientSession = bot.http_session - @group(name="movies", aliases=["movie"], invoke_without_command=True) + @group(name="movies", aliases=("movie",), invoke_without_command=True) async def movies(self, ctx: Context, genre: str = "", amount: int = 5) -> None: """ Get random movies by specifying genre. Also support amount parameter, that define how much movies will be shown. @@ -103,7 +103,7 @@ class Movie(Cog): await ImagePaginator.paginate(pages, ctx, embed) - @movies.command(name="genres", aliases=["genre", "g"]) + @movies.command(name="genres", aliases=("genre", "g")) async def genres(self, ctx: Context) -> None: """Show all currently available genres for .movies command.""" await ctx.send(f"Current available genres: {', '.join('`' + genre.name + '`' for genre in MovieGenres)}") diff --git a/bot/exts/evergreen/pythonfacts.py b/bot/exts/evergreen/pythonfacts.py index e162c9bd..606545ab 100644 --- a/bot/exts/evergreen/pythonfacts.py +++ b/bot/exts/evergreen/pythonfacts.py @@ -15,7 +15,7 @@ COLORS = itertools.cycle([Colours.python_blue, Colours.python_yellow]) class PythonFacts(commands.Cog): """Sends a random fun fact about Python.""" - @commands.command(name="pythonfact", aliases=["pyfact"]) + @commands.command(name="pythonfact", aliases=("pyfact",)) async def get_python_fact(self, ctx: commands.Context) -> None: """Sends a Random fun fact about Python.""" embed = discord.Embed( diff --git a/bot/exts/evergreen/recommend_game.py b/bot/exts/evergreen/recommend_game.py index 56596020..45108969 100644 --- a/bot/exts/evergreen/recommend_game.py +++ b/bot/exts/evergreen/recommend_game.py @@ -25,7 +25,7 @@ class RecommendGame(commands.Cog): self.bot = bot self.index = 0 - @commands.command(name="recommendgame", aliases=["gamerec"]) + @commands.command(name="recommendgame", aliases=("gamerec",)) async def recommend_game(self, ctx: commands.Context) -> None: """Sends an Embed of a random game recommendation.""" if self.index >= len(game_recs): diff --git a/bot/exts/evergreen/space.py b/bot/exts/evergreen/space.py index 6c991d26..5e87c6d5 100644 --- a/bot/exts/evergreen/space.py +++ b/bot/exts/evergreen/space.py @@ -193,7 +193,7 @@ class Space(Cog): ) ) - @mars.command(name="dates", aliases=["d", "date", "rover", "rovers", "r"]) + @mars.command(name="dates", aliases=("d", "date", "rover", "rovers", "r")) async def dates(self, ctx: Context) -> None: """Get current available rovers photo date ranges.""" await ctx.send("\n".join( diff --git a/bot/exts/evergreen/timed.py b/bot/exts/evergreen/timed.py index 491231cc..2ea6b419 100644 --- a/bot/exts/evergreen/timed.py +++ b/bot/exts/evergreen/timed.py @@ -18,7 +18,7 @@ class TimedCommands(commands.Cog): return await ctx.bot.get_context(msg) - @commands.command(name="timed", aliases=["time", "t"]) + @commands.command(name="timed", aliases=("time", "t")) async def timed(self, ctx: commands.Context, *, command: str) -> None: """Time the command execution of a command.""" new_ctx = await self.create_execution_context(ctx, command) diff --git a/bot/exts/evergreen/trivia_quiz.py b/bot/exts/evergreen/trivia_quiz.py index 9db201ef..352d5ae8 100644 --- a/bot/exts/evergreen/trivia_quiz.py +++ b/bot/exts/evergreen/trivia_quiz.py @@ -43,7 +43,7 @@ class TriviaQuiz(commands.Cog): p = Path("bot", "resources", "evergreen", "trivia_quiz.json") return json.loads(p.read_text("utf8")) - @commands.group(name="quiz", aliases=["trivia"], invoke_without_command=True) + @commands.group(name="quiz", aliases=("trivia",), invoke_without_command=True) async def quiz_game(self, ctx: commands.Context, category: str = None) -> None: """ Start a quiz! diff --git a/bot/exts/evergreen/wikipedia.py b/bot/exts/evergreen/wikipedia.py index fa21b916..83937438 100644 --- a/bot/exts/evergreen/wikipedia.py +++ b/bot/exts/evergreen/wikipedia.py @@ -72,7 +72,7 @@ class WikipediaSearch(commands.Cog): return @commands.cooldown(1, 10, commands.BucketType.user) - @commands.command(name="wikipedia", aliases=["wiki"]) + @commands.command(name="wikipedia", aliases=("wiki",)) async def wikipedia_search_command(self, ctx: commands.Context, *, search: str) -> None: """Sends paginated top 10 results of Wikipedia search..""" contents = await self.wiki_request(ctx.channel, search) diff --git a/bot/exts/evergreen/wonder_twins.py b/bot/exts/evergreen/wonder_twins.py index 437d69f1..40edf785 100644 --- a/bot/exts/evergreen/wonder_twins.py +++ b/bot/exts/evergreen/wonder_twins.py @@ -38,7 +38,7 @@ class WonderTwins(Cog): object_name = self.append_onto(adjective, object_name) return f"{object_name} of {water_type}" - @command(name="formof", aliases=["wondertwins", "wondertwin", "fo"]) + @command(name="formof", aliases=("wondertwins", "wondertwin", "fo")) async def form_of(self, ctx: Context) -> None: """Command to send a Wonder Twins inspired phrase to the user invoking the command.""" await ctx.send(f"Form of {self.format_phrase()}!") diff --git a/bot/exts/halloween/spookynamerate.py b/bot/exts/halloween/spookynamerate.py index 63040289..c9b42ef5 100644 --- a/bot/exts/halloween/spookynamerate.py +++ b/bot/exts/halloween/spookynamerate.py @@ -117,7 +117,7 @@ class SpookyNameRate(Cog): """Get help on the Spooky Name Rate game.""" await ctx.send(embed=Embed.from_dict(HELP_MESSAGE_DICT)) - @spooky_name_rate.command(name="list", aliases=["all", "entries"]) + @spooky_name_rate.command(name="list", aliases=("all", "entries")) async def list_entries(self, ctx: Context) -> None: """Send all the entries up till now in a single embed.""" await ctx.send(embed=await self.get_responses_list(final=False)) @@ -134,7 +134,7 @@ class SpookyNameRate(Cog): "add an entry." ) - @spooky_name_rate.command(name="add", aliases=["register"]) + @spooky_name_rate.command(name="add", aliases=("register",)) async def add_name(self, ctx: Context, *, name: str) -> None: """Use this command to add/register your spookified name.""" if self.poll: diff --git a/bot/exts/pride/drag_queen_name.py b/bot/exts/pride/drag_queen_name.py index 6bf43913..81eeaff5 100644 --- a/bot/exts/pride/drag_queen_name.py +++ b/bot/exts/pride/drag_queen_name.py @@ -21,7 +21,7 @@ class DragNames(commands.Cog): """Loads a list of drag queen names.""" return json.loads(Path("bot/resources/pride/drag_queen_names.json").read_text("utf8")) - @commands.command(name="dragname", aliases=["dragqueenname", "queenme"]) + @commands.command(name="dragname", aliases=("dragqueenname", "queenme")) async def dragname(self, ctx: commands.Context) -> None: """Sends a message with a drag queen name.""" await ctx.send(random.choice(self.names)) diff --git a/bot/exts/pride/pride_anthem.py b/bot/exts/pride/pride_anthem.py index 21b7e468..ce4b06af 100644 --- a/bot/exts/pride/pride_anthem.py +++ b/bot/exts/pride/pride_anthem.py @@ -38,7 +38,7 @@ class PrideAnthem(commands.Cog): """Loads a list of videos from the resources folder as dictionaries.""" return json.loads(Path("bot/resources/pride/anthems.json").read_text("utf8")) - @commands.command(name="prideanthem", aliases=["anthem", "pridesong"]) + @commands.command(name="prideanthem", aliases=("anthem", "pridesong")) async def prideanthem(self, ctx: commands.Context, genre: str = None) -> None: """ Sends a message with a video of a random pride anthem. diff --git a/bot/exts/pride/pride_facts.py b/bot/exts/pride/pride_facts.py index 47e69a03..5bea1d32 100644 --- a/bot/exts/pride/pride_facts.py +++ b/bot/exts/pride/pride_facts.py @@ -72,7 +72,7 @@ class PrideFacts(commands.Cog): else: await target.send("The fact for the selected day is not yet available.") - @commands.command(name="pridefact", aliases=["pridefacts"]) + @commands.command(name="pridefact", aliases=("pridefacts",)) async def pridefact(self, ctx: commands.Context, option: str = None) -> None: """ Sends a message with a pride fact of the day. diff --git a/bot/exts/valentines/valentine_zodiac.py b/bot/exts/valentines/valentine_zodiac.py index 45d1edd5..d862ee63 100644 --- a/bot/exts/valentines/valentine_zodiac.py +++ b/bot/exts/valentines/valentine_zodiac.py @@ -116,7 +116,7 @@ class ValentineZodiac(commands.Cog): await ctx.send(embed=final_embed) log.trace("Embed from date successfully sent.") - @zodiac.command(name="partnerzodiac", aliases=["partner"]) + @zodiac.command(name="partnerzodiac", aliases=("partner",)) async def partner_zodiac(self, ctx: commands.Context, zodiac_sign: str) -> None: """Provides a random counter compatible zodiac sign to the given user's zodiac sign.""" embed = discord.Embed() -- cgit v1.2.3