35 lines
1.5 KiB
Python
35 lines
1.5 KiB
Python
|
|
import discord
|
||
|
|
from discord import Embed
|
||
|
|
from discord.ext import commands
|
||
|
|
from libs.Channels import Channel
|
||
|
|
from libs.Guilds import Guilds
|
||
|
|
from libs.Cog import Cog
|
||
|
|
from views.MatrixButtons import MatrixButtons
|
||
|
|
from views.LanguageButtons import LanguageButtons
|
||
|
|
|
||
|
|
class RolesCog(Cog):
|
||
|
|
|
||
|
|
def __init__(self, bot):
|
||
|
|
super().__init__(bot)
|
||
|
|
self.bot = bot
|
||
|
|
self.messages_deletable = True
|
||
|
|
|
||
|
|
@commands.Cog.listener()
|
||
|
|
async def on_ready(self):
|
||
|
|
guild = await Guilds().get_guild(self.bot)
|
||
|
|
channel = await Channel().get_channel(guild, "add-roles")
|
||
|
|
matrix_embed = Embed(title="Matrix Roles", color=discord.Color.purple(), description="Please select your choice between these two roles. "
|
||
|
|
"\nClick to add. Click again to remove. "
|
||
|
|
"\nAlso, clicking on one of them will remove the other, if you have it. "
|
||
|
|
"\n(Clicking Matrix Penguins, will remove Matrix-Refuser Penguins and add Matrix Penguins).")
|
||
|
|
language_embed = Embed(title="Language Roles", color=discord.Color.purple(), description="Please select your choice of languages to be associated with. "
|
||
|
|
"\nClick to add. Click again to remove.")
|
||
|
|
|
||
|
|
if channel is not None:
|
||
|
|
await channel.purge()
|
||
|
|
await channel.send(embed=matrix_embed, view=MatrixButtons())
|
||
|
|
await channel.send(embed=language_embed, view=LanguageButtons())
|
||
|
|
|
||
|
|
|
||
|
|
async def setup(bot):
|
||
|
|
await bot.add_cog(RolesCog(bot))
|