Compare commits

..

2 commits

Author SHA1 Message Date
Funky Waddle 82c7508517 Modify TwitchGameNotificationEmbed tag field to 5 tags and remove inline 2025-06-23 09:03:54 -05:00
Funky Waddle 7181bd134a Convert role embeds to classes 2025-06-23 09:02:53 -05:00
4 changed files with 41 additions and 13 deletions

View file

@ -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):

View 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()

View 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()

View file

@ -21,7 +21,7 @@ class TwitchGameNotificationEmbed(Embed):
self.add_field(name="Game", value=f"{stream_data["game_name"]}", inline=True) self.add_field(name="Game", value=f"{stream_data["game_name"]}", inline=True)
self.add_field(name="Viewers", value=f"{stream_data["viewer_count"]}", inline=True) self.add_field(name="Viewers", value=f"{stream_data["viewer_count"]}", inline=True)
tags = stream_data["tags"] tags = stream_data["tags"]
if len(tags) > 3: if len(tags) > 5:
tags = tags[:3] tags = tags[:5]
tags.append('...') tags.append('...')
self.add_field(name="Tags", value=f"{", ".join(tags)}") self.add_field(name="Tags", value=f"{", ".join(tags)}", inline=False)