Files
WheatlyBot/react_roles/react_roles.py
2025-03-30 17:34:47 +10:00

32 lines
1.2 KiB
Python

import discord
from data import react_roles as db_react_roles
from util.console import console, panel, track_iterable as track
### EMBED CREATION ###
def generate_reaction_message_embed(description: str, thumbnail: str, uuid: str):
"""
Generate an embed message for the reaction role message.
"""
# Create an embed for the react-role category
embed = discord.Embed(title=f"**{description.capitalize()} Roles**",
thumbnail=f"{thumbnail}",
description="Use the reactions below to be granted access to the relevant text and "
"voice channels. Remove your reaction to remove access. Simples!!! \n\n",
color=discord.Color.dark_orange())
embed.set_footer(text=f"Reaction Role ID: {uuid}")
return embed
def required_emojis_for_reaction_message(message_id):
"""
Get the required emojis for a reaction message.
"""
# Get the emojis for the reaction message
message_db_data = db_react_roles.get_reaction_message_by_id(message_id)
emojis = []
for message in message_db_data:
emojis.append(message[2])
if not emojis:
return None
return emojis