-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
BuildTools
committed
Nov 13, 2023
1 parent
b44ebc5
commit 430dd06
Showing
4 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,7 @@ class HeckBot(commands.Bot): | |
'moderation', | ||
'poll', | ||
'react', | ||
'roles', | ||
] | ||
|
||
def __init__(self): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
aiohttp~=3.8.4 | ||
colorama~=0.4.6 | ||
discord~=2.2.2 | ||
discord~=2.3.2 | ||
dpytest~=0.6.4 | ||
heckbot | ||
pynacl~=1.5.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
from __future__ import annotations | ||
|
||
import asyncio | ||
|
||
import discord | ||
from discord.ext import commands | ||
from discord.ext.commands import Bot | ||
from discord.ext.commands import Context | ||
from heckbot.adapter.reaction_table_adapter import ReactionTableAdapter | ||
|
||
from bot import HeckBot | ||
|
||
|
||
class Roles(commands.Cog): | ||
""" | ||
Cog for enabling role-selection related features in the bot. | ||
""" | ||
|
||
def __init__( | ||
self, | ||
bot: HeckBot, | ||
) -> None: | ||
""" | ||
Constructor method | ||
:param bot: Instance of the running Bot | ||
""" | ||
self._bot = bot | ||
|
||
@commands.command(aliases=['createrolesmessage', 'createrolesmsg']) | ||
@commands.has_permissions(kick_members=True) | ||
@commands.bot_has_permissions(kick_members=True) | ||
async def create_roles_message(self, ctx: Context): | ||
""" | ||
Sends a role-reaction-enabled message in the current chat. | ||
:param ctx: Context of the command | ||
""" | ||
await ctx.author.send(f'{ctx.guild.roles}') | ||
|
||
|
||
async def setup( | ||
bot: HeckBot, | ||
) -> None: | ||
""" | ||
Setup function for registering the react-match cog. | ||
:param bot: Instance of the running Bot | ||
""" | ||
await bot.add_cog(Roles(bot)) |