memes.py: Implement cade alert
@@ -11,7 +11,7 @@ class Memes(commands.Cog):
def __init__(self, bot):
self.bot = bot
- async def _meme(self, ctx, msg, directed: bool = False, imagelink=None):
+ async def _meme(self, ctx, msg, directed: bool = False, imagelink=None, allowed_mentions=None):
author = ctx.author
if isinstance(ctx.channel, discord.abc.GuildChannel) and (ctx.channel in self.bot.assistance_channels or (self.bot.roles['No-Memes'] in author.roles)):
await ctx.message.delete()
@@ -25,7 +25,7 @@ class Memes(commands.Cog):
embed.set_image(url=imagelink)
await ctx.send(embed=embed)
else:
- await ctx.send(f"{self.bot.escape_text(ctx.author.display_name) + ':' if not directed else ''} {msg}")
+ await ctx.send(f"{self.bot.escape_text(ctx.author.display_name) + ':' if not directed else ''} {msg}", allowed_mentions=allowed_mentions)
# list memes
@commands.command(name="listmemes")
@@ -439,5 +439,12 @@ class Memes(commands.Cog):
"""citation needed"""
await self._meme(ctx, "", imagelink="https://eiphax.tech/assets/source2.jpg")
+ @commands.command(hidden=True)
+ @commands.cooldown(rate=1, per=120.0, type=commands.BucketType.channel)
+ async def cadealert(self, ctx):
+ """stop! cade time."""
+ await self._meme(ctx, "excuse me <@&575940388452433940>, it is time for cade", allowed_mentions=discord.AllowedMentions(roles=True))
+
+
def setup(bot):
bot.add_cog(Memes(bot))
