commit
b2f7ba8f5b
@ -9,6 +9,7 @@ Cog Function
|
|||||||
| coglint | **Alpha** | <details><summary>Error check code in python syntax posted to discord</summary>Works, but probably needs more turning to work for cogs</details> |
|
| coglint | **Alpha** | <details><summary>Error check code in python syntax posted to discord</summary>Works, but probably needs more turning to work for cogs</details> |
|
||||||
| fight | **Incomplete** | <details><summary>Organize bracket tournaments within discord</summary>Still in-progress, a massive project</details> |
|
| fight | **Incomplete** | <details><summary>Organize bracket tournaments within discord</summary>Still in-progress, a massive project</details> |
|
||||||
| flag | **Incomplete** | <details><summary>Create temporary marks on users that expire after specified time</summary>Not yet ported to v3</details> |
|
| flag | **Incomplete** | <details><summary>Create temporary marks on users that expire after specified time</summary>Not yet ported to v3</details> |
|
||||||
|
| forcemention | **Alpha** | <details><summary>Mentions unmentionable roles</summary>Very simple cog, mention doesn't persist</details> |
|
||||||
| hangman | **Alpha** | <details><summary>Play a game of hangman</summary>Some visual glitches and needs more customization</details> |
|
| hangman | **Alpha** | <details><summary>Play a game of hangman</summary>Some visual glitches and needs more customization</details> |
|
||||||
| howdoi | **Incomplete** | <details><summary>Create temporary marks on users that expire after specified time</summary>Not yet ported to v3</details> |
|
| howdoi | **Incomplete** | <details><summary>Create temporary marks on users that expire after specified time</summary>Not yet ported to v3</details> |
|
||||||
| leaver | **Incomplete** | <details><summary>Send a message in a channel when a user leaves the server</summary>Not yet ported to v3</details> |
|
| leaver | **Incomplete** | <details><summary>Send a message in a channel when a user leaves the server</summary>Not yet ported to v3</details> |
|
||||||
|
5
forcemention/__init__.py
Normal file
5
forcemention/__init__.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
from .forcemention import ForceMention
|
||||||
|
|
||||||
|
|
||||||
|
def setup(bot):
|
||||||
|
bot.add_cog(ForceMention(bot))
|
38
forcemention/forcemention.py
Normal file
38
forcemention/forcemention.py
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
from discord.utils import get
|
||||||
|
|
||||||
|
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: 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)
|
||||||
|
await role.edit(mentionable=False)
|
||||||
|
else:
|
||||||
|
await ctx.send(role.mention)
|
19
forcemention/info..json
Normal file
19
forcemention/info..json
Normal file
@ -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"
|
||||||
|
]
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user