Files
WheatlyBot/react_roles/react_roles.py

17 lines
679 B
Python

import discord
from data import react_roles
def update_react_role_embed(category_name):
# Generate role list
roles = react_roles.get_react_roles_by_category(category_name)
role_list = []
for role in roles:
emoji = role[2]
description = role[3]
role_list.append(f"{emoji} - {description}")
# Create an embed for the react-role category
embed = discord.Embed(title=f"**{category_name.capitalize()} Roles**",
description="React to this message to gain access to the relevant text and voice channels.\n\n" + "\n".join(role_list),
color=discord.Color.dark_orange())
return embed