diff --git a/cogs/miscellaneous/__init__.py b/cogs/miscellaneous/__init__.py new file mode 100644 index 0000000..216489d --- /dev/null +++ b/cogs/miscellaneous/__init__.py @@ -0,0 +1,59 @@ +import discord +from discord.ext import commands +from discord.ext.commands import Context + +from .rickroll import rr_command +from .labubu import labubu_command +from .tryitandsee import tryitandsee_command +from .piracy import piracy_command +from .keanu import keanu_command + +class Miscellaneous(commands.GroupCog, name="miscellaneous"): + def __init__(self, bot) -> None: + self.bot = bot + super().__init__() + + @commands.hybrid_command( + name="rr", + description="Rickroll" + ) + async def rr(self, context): + return await rr_command()(self, context) + + @commands.hybrid_command( + name="labubu", + description="Labubu ASCII art" + ) + async def labubu(self, context): + return await labubu_command()(self, context) + + @commands.hybrid_command( + name="tryitandsee", + description="Try it and see" + ) + async def tryitandsee(self, context): + return await tryitandsee_command()(self, context) + + @commands.hybrid_command( + name="piracy", + description="FBI Anti Piracy Warning" + ) + async def piracy(self, context): + return await piracy_command()(self, context) + + @commands.hybrid_command( + name="keanu", + description="Reeves" + ) + async def keanu(self, context): + return await keanu_command()(self, context) + +async def setup(bot) -> None: + cog = Miscellaneous(bot) + await bot.add_cog(cog) + + bot.logger.info("Loaded extension 'miscellaneous.rr'") + bot.logger.info("Loaded extension 'miscellaneous.labubu'") + bot.logger.info("Loaded extension 'miscellaneous.tryitandsee'") + bot.logger.info("Loaded extension 'miscellaneous.piracy'") + bot.logger.info("Loaded extension 'miscellaneous.keanu'") diff --git a/cogs/miscellaneous/keanu.py b/cogs/miscellaneous/keanu.py index bcd462a..9384484 100644 --- a/cogs/miscellaneous/keanu.py +++ b/cogs/miscellaneous/keanu.py @@ -4,15 +4,12 @@ from discord.ext.commands import Context import random -class Keanu(commands.Cog, name="keanu"): - def __init__(self, bot) -> None: - self.bot = bot - +def keanu_command(): @commands.hybrid_command( name="keanu", description="Reeves", ) - async def keanu(self, context: Context) -> None: + async def keanu(self, context): images = [ "https://yes.nighty.works/raw/z0HqUM.png", "https://yes.nighty.works/raw/1Jc0j6.avif", @@ -48,7 +45,5 @@ class Keanu(commands.Cog, name="keanu"): await inter.followup.send(embed=embed, ephemeral=True) else: await context.send(embed=embed) - - -async def setup(bot) -> None: - await bot.add_cog(Keanu(bot)) + + return keanu diff --git a/cogs/miscellaneous/labubu.py b/cogs/miscellaneous/labubu.py index 28f2f19..4f2d9bc 100644 --- a/cogs/miscellaneous/labubu.py +++ b/cogs/miscellaneous/labubu.py @@ -3,15 +3,12 @@ from discord.ext import commands from discord.ext.commands import Context -class Labubu(commands.Cog, name="labubu"): - def __init__(self, bot) -> None: - self.bot = bot - +def labubu_command(): @commands.hybrid_command( name="labubu", description="Labubu ASCII art", ) - async def labubu(self, context: Context) -> None: + async def labubu(self, context): labubu_art = """⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⠀⠙⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠗⠀⠀⣀⣄⠀⢿⣿⣿⣿⠟⠁⢠⡆⠉⠙⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠀⠀⣴⣿⡟⠀⠘⣿⣿⠋⠀⠀⠀⢠⣶⡀⠈⢻⣿⣿⣿⣿⣿⣿⣿⣿ @@ -63,7 +60,5 @@ class Labubu(commands.Cog, name="labubu"): await inter.followup.send(embed=embed, ephemeral=True) else: await context.send(embed=embed) - - -async def setup(bot) -> None: - await bot.add_cog(Labubu(bot)) + + return labubu diff --git a/cogs/miscellaneous/piracy.py b/cogs/miscellaneous/piracy.py index fd02dc1..9fe5b34 100644 --- a/cogs/miscellaneous/piracy.py +++ b/cogs/miscellaneous/piracy.py @@ -3,15 +3,12 @@ from discord.ext import commands from discord.ext.commands import Context -class Piracy(commands.Cog, name="piracy"): - def __init__(self, bot) -> None: - self.bot = bot - +def piracy_command(): @commands.hybrid_command( name="piracy", description="FBI Anti Piracy Warning", ) - async def piracy(self, context: Context) -> None: + async def piracy(self, context): embed = discord.Embed( color=0xE02B2B, ) @@ -27,7 +24,5 @@ class Piracy(commands.Cog, name="piracy"): await inter.followup.send(embed=embed, ephemeral=True) else: await context.send(embed=embed) - - -async def setup(bot) -> None: - await bot.add_cog(Piracy(bot)) + + return piracy diff --git a/cogs/miscellaneous/rickroll.py b/cogs/miscellaneous/rickroll.py index 0cdf1ad..fbf83ae 100644 --- a/cogs/miscellaneous/rickroll.py +++ b/cogs/miscellaneous/rickroll.py @@ -3,15 +3,12 @@ from discord.ext import commands from discord.ext.commands import Context -class Rr(commands.Cog, name="rr"): - def __init__(self, bot) -> None: - self.bot = bot - +def rr_command(): @commands.hybrid_command( name="rr", description="Rickroll", ) - async def rr(self, context: Context) -> None: + async def rr(self, context): gif_url = "https://yes.nighty.works/raw/JzjMcs.gif" embed = discord.Embed( @@ -28,7 +25,5 @@ class Rr(commands.Cog, name="rr"): await inter.followup.send(embed=embed, ephemeral=True) else: await context.send(embed=embed) - - -async def setup(bot) -> None: - await bot.add_cog(Rr(bot)) + + return rr diff --git a/cogs/miscellaneous/tryitandsee.py b/cogs/miscellaneous/tryitandsee.py index 6ac67f0..461a77f 100644 --- a/cogs/miscellaneous/tryitandsee.py +++ b/cogs/miscellaneous/tryitandsee.py @@ -3,15 +3,12 @@ from discord.ext import commands from discord.ext.commands import Context -class TryItAndSee(commands.Cog, name="tryitandsee"): - def __init__(self, bot) -> None: - self.bot = bot - +def tryitandsee_command(): @commands.hybrid_command( name="tryitandsee", description="Try it and see", ) - async def tryitandsee(self, context: Context) -> None: + async def tryitandsee(self, context): gif_url = "https://yes.nighty.works/raw/1BQP8c.gif" embed = discord.Embed( @@ -28,7 +25,5 @@ class TryItAndSee(commands.Cog, name="tryitandsee"): await inter.followup.send(embed=embed, ephemeral=True) else: await context.send(embed=embed) - - -async def setup(bot) -> None: - await bot.add_cog(TryItAndSee(bot)) + + return tryitandsee