From a3e35f1249503a94e05e14347b4d56fa75691fe4 Mon Sep 17 00:00:00 2001 From: Bobloy Date: Mon, 14 May 2018 12:12:42 -0400 Subject: [PATCH] Forcemention inital commit Signed-off-by: Bobloy --- forcemention/__init__.py | 5 +++++ forcemention/forcemention.py | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 forcemention/__init__.py create mode 100644 forcemention/forcemention.py diff --git a/forcemention/__init__.py b/forcemention/__init__.py new file mode 100644 index 0000000..a2a8ee7 --- /dev/null +++ b/forcemention/__init__.py @@ -0,0 +1,5 @@ +from .forcemention import ForceMention + + +def setup(bot): + bot.add_cog(ForceMention(bot)) diff --git a/forcemention/forcemention.py b/forcemention/forcemention.py new file mode 100644 index 0000000..3a1f0f5 --- /dev/null +++ b/forcemention/forcemention.py @@ -0,0 +1,33 @@ +import discord + +from redbot.core import Config, checks, commands + +from redbot.core.bot import Red + + +class ForceMention: + """ + V3 Cog Template + """ + + def __init__(self, bot: Red): + self.bot = bot + self.config = Config.get_conf(self, identifier=9811198108111121, force_registration=True) + default_global = {} + default_guild = {} + + self.config.register_global(**default_global) + self.config.register_guild(**default_guild) + + @checks.admin_or_permissions(manage_roles=True) + @commands.command() + async def forcemention(self, ctx: commands.Context, role: discord.Role): + """ + Mentions that role, regardless if it's unmentionable + """ + if not role.mentionable: + await role.edit(mentionable=True) + await ctx.send(role.mention) + await role.edit(mentionable=False) + else: + await ctx.send(role.mention)