Convert role embeds to classes
This commit is contained in:
parent
8abfc48ef5
commit
7181bd134a
|
|
@ -1,6 +1,6 @@
|
||||||
import discord
|
|
||||||
from discord import Embed
|
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
|
from embeds.MatrixRolesEmbed import MatrixRolesEmbed
|
||||||
|
from embeds.LanguageRolesEmbed import LanguageRolesEmbed
|
||||||
from libs.Channels import Channels
|
from libs.Channels import Channels
|
||||||
from libs.Guilds import Guilds
|
from libs.Guilds import Guilds
|
||||||
from libs.Cog import Cog
|
from libs.Cog import Cog
|
||||||
|
|
@ -18,17 +18,11 @@ class RolesCog(Cog):
|
||||||
async def on_ready(self):
|
async def on_ready(self):
|
||||||
guild = await Guilds().get_guild(self.bot)
|
guild = await Guilds().get_guild(self.bot)
|
||||||
channel = await Channels().get_channel(guild, "add-roles")
|
channel = await Channels().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:
|
if channel is not None:
|
||||||
await channel.purge()
|
await channel.purge()
|
||||||
# await channel.send(embed=matrix_embed, view=MatrixButtons())
|
await channel.send(embed=MatrixRolesEmbed(), view=MatrixButtons())
|
||||||
# await channel.send(embed=language_embed, view=LanguageButtons())
|
await channel.send(embed=LanguageRolesEmbed(), view=LanguageButtons())
|
||||||
|
|
||||||
|
|
||||||
async def setup(bot):
|
async def setup(bot):
|
||||||
|
|
|
||||||
15
embeds/LanguageRolesEmbed.py
Normal file
15
embeds/LanguageRolesEmbed.py
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
import discord
|
||||||
|
from discord import Embed
|
||||||
|
|
||||||
|
|
||||||
|
class LanguageRolesEmbed(Embed):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__()
|
||||||
|
self.title = "Language Roles"
|
||||||
|
self.description = ("Please select your choice of languages to be associated with."
|
||||||
|
"\nThese roles provide no functionality other than being alerted when it is tagged."
|
||||||
|
"\nThis is mainly for when someone shares information about the programming language"
|
||||||
|
" or is in need of help and asking a question")
|
||||||
|
self.add_field(name="Instructions", value="Click to add. Click again to remove.", inline=False)
|
||||||
|
self.color = discord.Color.purple()
|
||||||
19
embeds/MatrixRolesEmbed.py
Normal file
19
embeds/MatrixRolesEmbed.py
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
import discord
|
||||||
|
from discord import Embed
|
||||||
|
|
||||||
|
|
||||||
|
class MatrixRolesEmbed(Embed):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__()
|
||||||
|
self.title = "Matrix Roles"
|
||||||
|
self.description = ("Please select your choice between these two roles. "
|
||||||
|
"\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).")
|
||||||
|
self.add_field(name="Instructions", value="Click to add. Click again to remove.", inline=False)
|
||||||
|
|
||||||
|
self.add_field(name="Matrix Penguins", value="By accepting this role, you will be alerted whenever someone tags the role in one of the Tech channels", inline=True)
|
||||||
|
self.add_field(name="Matrix-Refuser Penguins",
|
||||||
|
value="By accepting this role, all of the Techie/Geeky channels will be hidden, and you can just enjoy the basic channels, participating in polls, etc",
|
||||||
|
inline=True)
|
||||||
|
self.color = discord.Color.purple()
|
||||||
Loading…
Reference in a new issue