From a3e35f1249503a94e05e14347b4d56fa75691fe4 Mon Sep 17 00:00:00 2001 From: Bobloy Date: Mon, 14 May 2018 12:12:42 -0400 Subject: [PATCH 1/5] 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) From e9036b045a62fe16b592bec18431ecb3c3defa18 Mon Sep 17 00:00:00 2001 From: Bobloy Date: Mon, 14 May 2018 13:19:55 -0400 Subject: [PATCH 2/5] Add info.json Signed-off-by: Bobloy --- README.md | 1 + forcemention/info..json | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 forcemention/info..json diff --git a/README.md b/README.md index 0bb7fc2..2ecdf51 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ Cog Function | coglint | **Alpha** |
Error check code in python syntax posted to discordWorks, but probably needs more turning to work for cogs
| | fight | **Incomplete** |
Organize bracket tournaments within discordStill in-progress, a massive project
| | flag | **Incomplete** |
Create temporary marks on users that expire after specified timeNot yet ported to v3
| +| forcemention | **Alpha** |
Mentions unmentionable rolesVery simple cog, mention doesn't persist
| | hangman | **Alpha** |
Play a game of hangmanSome visual glitches and needs more customization
| | howdoi | **Incomplete** |
Create temporary marks on users that expire after specified timeNot yet ported to v3
| | leaver | **Incomplete** |
Send a message in a channel when a user leaves the serverNot yet ported to v3
| diff --git a/forcemention/info..json b/forcemention/info..json new file mode 100644 index 0000000..d08fab6 --- /dev/null +++ b/forcemention/info..json @@ -0,0 +1,19 @@ +{ + "author": [ + "Bobloy" + ], + "bot_version": [ + 3, + 0, + 0 + ], + "description": "Mentions roles that are unmentionable", + "hidden": true, + "install_msg": "Thank you for installing ForceMention! Get started with `[p]forcemention`", + "requirements": [], + "short": "Mention unmentionables", + "tags": [ + "bobloy", + "utils" + ] +} \ No newline at end of file From 6af592732cbc14f9fd954e0b74b7b017e6ea1276 Mon Sep 17 00:00:00 2001 From: Bobloy Date: Mon, 14 May 2018 13:22:49 -0400 Subject: [PATCH 3/5] Add info.json Signed-off-by: Bobloy --- lseen/info..json | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 lseen/info..json diff --git a/lseen/info..json b/lseen/info..json new file mode 100644 index 0000000..9f69325 --- /dev/null +++ b/lseen/info..json @@ -0,0 +1,20 @@ +{ + "author": [ + "Bobloy" + ], + "bot_version": [ + 3, + 0, + 0 + ], + "description": "Keep track of when users were last seen online", + "hidden": true, + "install_msg": "Thank you for installing LastSeen. Get started with `[p]help LastSeen`", + "requirements": [], + "short": "Last seen tracker", + "tags": [ + "bobloy", + "utils", + "tools" + ] +} \ No newline at end of file From 885abc82b61a36d8dd292984760cd02daaf47b9c Mon Sep 17 00:00:00 2001 From: Bobloy Date: Mon, 14 May 2018 13:28:17 -0400 Subject: [PATCH 4/5] Role as str to get roles with spaces Signed-off-by: Bobloy --- forcemention/forcemention.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/forcemention/forcemention.py b/forcemention/forcemention.py index 3a1f0f5..1a3e76e 100644 --- a/forcemention/forcemention.py +++ b/forcemention/forcemention.py @@ -1,4 +1,4 @@ -import discord +from discord.utils import get from redbot.core import Config, checks, commands @@ -21,10 +21,15 @@ class ForceMention: @checks.admin_or_permissions(manage_roles=True) @commands.command() - async def forcemention(self, ctx: commands.Context, role: discord.Role): + async def forcemention(self, ctx: commands.Context, role: str): """ Mentions that role, regardless if it's unmentionable """ + role = get(ctx.guild.roles, name=role) + if role is None: + await ctx.maybe_send_embed("Couldn't find role with that name") + return + if not role.mentionable: await role.edit(mentionable=True) await ctx.send(role.mention) From 9824edeff2290726bb0152bc500ec5ceb8b18faf Mon Sep 17 00:00:00 2001 From: Bobloy Date: Mon, 14 May 2018 16:14:09 -0400 Subject: [PATCH 5/5] fight import commands (downloader errors) --- fight/fight.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fight/fight.py b/fight/fight.py index b050de8..b611e1f 100644 --- a/fight/fight.py +++ b/fight/fight.py @@ -4,7 +4,7 @@ import math # from typing import Union import discord - +from redbot.core.commands import commands from redbot.core.utils.chat_formatting import pagify from redbot.core.utils.chat_formatting import box