1
Fork 0
mirror of https://github.com/wlinator/luminara.git synced 2024-10-02 16:23:12 +00:00

refactor: Update Builder theme usage in multiple files

This commit is contained in:
wlinator 2024-09-03 06:16:21 -04:00
parent 74bd05dd75
commit c8dab31b13
28 changed files with 118 additions and 108 deletions

View file

@ -49,7 +49,7 @@ class LuminaraHelp(commands.HelpCommand):
The created embed. The created embed.
""" """
return Builder.create_embed( return Builder.create_embed(
theme="info", Builder.INFO,
author_text=author, author_text=author,
description=description, description=description,
footer_text=CONST.STRINGS["help_footer"], footer_text=CONST.STRINGS["help_footer"],
@ -185,7 +185,7 @@ class LuminaraHelp(commands.HelpCommand):
The error message to be sent. The error message to be sent.
""" """
embed = Builder.create_embed( embed = Builder.create_embed(
theme="error", Builder.ERROR,
title="Error in help command", title="Error in help command",
description=error, description=error,
) )

View file

@ -39,7 +39,7 @@ class Sql(commands.Cog):
try: try:
results = database.select_query(f"SELECT {query}") results = database.select_query(f"SELECT {query}")
embed = Builder.create_embed( embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=ctx.author.name, user_name=ctx.author.name,
author_text=CONST.STRINGS["admin_sql_select_title"], author_text=CONST.STRINGS["admin_sql_select_title"],
description=CONST.STRINGS["admin_sql_select_description"].format( description=CONST.STRINGS["admin_sql_select_description"].format(
@ -50,7 +50,7 @@ class Sql(commands.Cog):
) )
except mysql.connector.Error as error: except mysql.connector.Error as error:
embed = Builder.create_embed( embed = Builder.create_embed(
theme="error", Builder.ERROR,
user_name=ctx.author.name, user_name=ctx.author.name,
author_text=CONST.STRINGS["admin_sql_select_error_title"], author_text=CONST.STRINGS["admin_sql_select_error_title"],
description=CONST.STRINGS["admin_sql_select_error_description"].format( description=CONST.STRINGS["admin_sql_select_error_description"].format(
@ -83,7 +83,7 @@ class Sql(commands.Cog):
try: try:
database.execute_query(query) database.execute_query(query)
embed = Builder.create_embed( embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=ctx.author.name, user_name=ctx.author.name,
author_text=CONST.STRINGS["admin_sql_inject_title"], author_text=CONST.STRINGS["admin_sql_inject_title"],
description=CONST.STRINGS["admin_sql_inject_description"].format( description=CONST.STRINGS["admin_sql_inject_description"].format(
@ -93,7 +93,7 @@ class Sql(commands.Cog):
) )
except mysql.connector.Error as error: except mysql.connector.Error as error:
embed = Builder.create_embed( embed = Builder.create_embed(
theme="error", Builder.ERROR,
user_name=ctx.author.name, user_name=ctx.author.name,
author_text=CONST.STRINGS["admin_sql_inject_error_title"], author_text=CONST.STRINGS["admin_sql_inject_error_title"],
description=CONST.STRINGS["admin_sql_inject_error_description"].format( description=CONST.STRINGS["admin_sql_inject_error_description"].format(

View file

@ -38,7 +38,7 @@ class Award(commands.Cog):
curr.push() curr.push()
embed = Builder.create_embed( embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=ctx.author.name, user_name=ctx.author.name,
author_text=CONST.STRINGS["admin_award_title"], author_text=CONST.STRINGS["admin_award_title"],
description=CONST.STRINGS["admin_award_description"].format( description=CONST.STRINGS["admin_award_description"].format(

View file

@ -37,7 +37,7 @@ class Blacklist(commands.Cog):
blacklist_service.add_to_blacklist(reason) blacklist_service.add_to_blacklist(reason)
embed = Builder.create_embed( embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=ctx.author.name, user_name=ctx.author.name,
author_text=CONST.STRINGS["admin_blacklist_author"], author_text=CONST.STRINGS["admin_blacklist_author"],
description=CONST.STRINGS["admin_blacklist_description"].format(user.name), description=CONST.STRINGS["admin_blacklist_description"].format(user.name),

View file

@ -46,7 +46,7 @@ class Birthday(commands.GroupCog, group_name="birthday"):
message = random.choice(CONST.BIRTHDAY_MESSAGES) message = random.choice(CONST.BIRTHDAY_MESSAGES)
embed = Builder.create_embed( embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
author_text="Happy Birthday!", author_text="Happy Birthday!",
description=message.format(member.name), description=message.format(member.name),
hide_name_in_description=True, hide_name_in_description=True,
@ -118,7 +118,7 @@ class Birthday(commands.GroupCog, group_name="birthday"):
birthday.set(date_obj) birthday.set(date_obj)
embed = Builder.create_embed( embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=interaction.user.name, user_name=interaction.user.name,
author_text=CONST.STRINGS["birthday_add_success_author"], author_text=CONST.STRINGS["birthday_add_success_author"],
description=CONST.STRINGS["birthday_add_success_description"].format( description=CONST.STRINGS["birthday_add_success_description"].format(
@ -146,7 +146,7 @@ class Birthday(commands.GroupCog, group_name="birthday"):
BirthdayService(interaction.user.id, interaction.guild.id).delete() BirthdayService(interaction.user.id, interaction.guild.id).delete()
embed = Builder.create_embed( embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=interaction.user.name, user_name=interaction.user.name,
author_text=CONST.STRINGS["birthday_delete_success_author"], author_text=CONST.STRINGS["birthday_delete_success_author"],
description=CONST.STRINGS["birthday_delete_success_description"], description=CONST.STRINGS["birthday_delete_success_description"],
@ -173,7 +173,7 @@ class Birthday(commands.GroupCog, group_name="birthday"):
if not upcoming_birthdays: if not upcoming_birthdays:
embed = Builder.create_embed( embed = Builder.create_embed(
theme="warning", Builder.WARNING,
user_name=interaction.user.name, user_name=interaction.user.name,
author_text=CONST.STRINGS["birthday_upcoming_no_birthdays_author"], author_text=CONST.STRINGS["birthday_upcoming_no_birthdays_author"],
description=CONST.STRINGS["birthday_upcoming_no_birthdays"], description=CONST.STRINGS["birthday_upcoming_no_birthdays"],
@ -182,7 +182,7 @@ class Birthday(commands.GroupCog, group_name="birthday"):
return return
embed = Builder.create_embed( embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=interaction.user.name, user_name=interaction.user.name,
author_text=CONST.STRINGS["birthday_upcoming_author"], author_text=CONST.STRINGS["birthday_upcoming_author"],
description="", description="",

View file

@ -41,7 +41,7 @@ class Config(commands.GroupCog, group_name="config"):
guild_config: GuildConfig = GuildConfig(interaction.guild.id) guild_config: GuildConfig = GuildConfig(interaction.guild.id)
guild: discord.Guild = interaction.guild guild: discord.Guild = interaction.guild
embed: discord.Embed = Builder.create_embed( embed: discord.Embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=interaction.user.name, user_name=interaction.user.name,
author_text=CONST.STRINGS["config_show_author"].format(guild.name), author_text=CONST.STRINGS["config_show_author"].format(guild.name),
thumbnail_url=guild.icon.url if guild.icon else CONST.LUMI_LOGO_TRANSPARENT, thumbnail_url=guild.icon.url if guild.icon else CONST.LUMI_LOGO_TRANSPARENT,
@ -117,7 +117,7 @@ class Config(commands.GroupCog, group_name="config"):
guild_config.push() guild_config.push()
embed = Builder.create_embed( embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=interaction.user.name, user_name=interaction.user.name,
author_text=CONST.STRINGS["config_author"], author_text=CONST.STRINGS["config_author"],
description=CONST.STRINGS["config_birthday_channel_set"].format( description=CONST.STRINGS["config_birthday_channel_set"].format(
@ -142,7 +142,7 @@ class Config(commands.GroupCog, group_name="config"):
if not guild_config.birthday_channel_id: if not guild_config.birthday_channel_id:
embed = Builder.create_embed( embed = Builder.create_embed(
theme="warning", Builder.WARNING,
user_name=interaction.user.name, user_name=interaction.user.name,
author_text=CONST.STRINGS["config_author"], author_text=CONST.STRINGS["config_author"],
description=CONST.STRINGS["config_birthday_module_already_disabled"], description=CONST.STRINGS["config_birthday_module_already_disabled"],
@ -150,7 +150,7 @@ class Config(commands.GroupCog, group_name="config"):
else: else:
embed = Builder.create_embed( embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=interaction.user.name, user_name=interaction.user.name,
author_text=CONST.STRINGS["config_author"], author_text=CONST.STRINGS["config_author"],
description=CONST.STRINGS["config_birthday_module_disabled"], description=CONST.STRINGS["config_birthday_module_disabled"],
@ -178,7 +178,7 @@ class Config(commands.GroupCog, group_name="config"):
guild_config.push() guild_config.push()
embed = Builder.create_embed( embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=interaction.user.name, user_name=interaction.user.name,
author_text=CONST.STRINGS["config_author"], author_text=CONST.STRINGS["config_author"],
description=CONST.STRINGS["config_level_channel_set"].format(channel.mention), description=CONST.STRINGS["config_level_channel_set"].format(channel.mention),
@ -207,7 +207,7 @@ class Config(commands.GroupCog, group_name="config"):
guild_config.push() guild_config.push()
embed = Builder.create_embed( embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=interaction.user.name, user_name=interaction.user.name,
author_text=CONST.STRINGS["config_author"], author_text=CONST.STRINGS["config_author"],
description=CONST.STRINGS["config_boost_channel_set"].format(channel.mention), description=CONST.STRINGS["config_boost_channel_set"].format(channel.mention),
@ -230,7 +230,7 @@ class Config(commands.GroupCog, group_name="config"):
if not guild_config.boost_channel_id: if not guild_config.boost_channel_id:
embed = Builder.create_embed( embed = Builder.create_embed(
theme="warning", Builder.WARNING,
user_name=interaction.user.name, user_name=interaction.user.name,
author_text=CONST.STRINGS["config_author"], author_text=CONST.STRINGS["config_author"],
description=CONST.STRINGS["config_boost_module_already_disabled"], description=CONST.STRINGS["config_boost_module_already_disabled"],
@ -240,7 +240,7 @@ class Config(commands.GroupCog, group_name="config"):
guild_config.boost_message = None guild_config.boost_message = None
guild_config.push() guild_config.push()
embed = Builder.create_embed( embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=interaction.user.name, user_name=interaction.user.name,
author_text=CONST.STRINGS["config_author"], author_text=CONST.STRINGS["config_author"],
description=CONST.STRINGS["config_boost_module_disabled"], description=CONST.STRINGS["config_boost_module_disabled"],
@ -266,7 +266,7 @@ class Config(commands.GroupCog, group_name="config"):
guild_config.push() guild_config.push()
embed = Builder.create_embed( embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=interaction.user.name, user_name=interaction.user.name,
author_text=CONST.STRINGS["config_author"], author_text=CONST.STRINGS["config_author"],
description=CONST.STRINGS["config_boost_template_updated"], description=CONST.STRINGS["config_boost_template_updated"],
@ -317,7 +317,7 @@ class Config(commands.GroupCog, group_name="config"):
guild_config.push() guild_config.push()
embed = Builder.create_embed( embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=interaction.user.name, user_name=interaction.user.name,
author_text=CONST.STRINGS["config_author"], author_text=CONST.STRINGS["config_author"],
description=CONST.STRINGS["config_boost_image_updated"], description=CONST.STRINGS["config_boost_image_updated"],
@ -358,7 +358,7 @@ class Config(commands.GroupCog, group_name="config"):
guild_config.push() guild_config.push()
embed: discord.Embed = Builder.create_embed( embed: discord.Embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=interaction.user.name, user_name=interaction.user.name,
author_text=CONST.STRINGS["config_author"], author_text=CONST.STRINGS["config_author"],
description=CONST.STRINGS["config_welcome_channel_set"].format(channel.mention), description=CONST.STRINGS["config_welcome_channel_set"].format(channel.mention),
@ -381,7 +381,7 @@ class Config(commands.GroupCog, group_name="config"):
if not guild_config.welcome_channel_id: if not guild_config.welcome_channel_id:
embed: discord.Embed = Builder.create_embed( embed: discord.Embed = Builder.create_embed(
theme="warning", Builder.WARNING,
user_name=interaction.user.name, user_name=interaction.user.name,
author_text=CONST.STRINGS["config_author"], author_text=CONST.STRINGS["config_author"],
description=CONST.STRINGS["config_welcome_module_already_disabled"], description=CONST.STRINGS["config_welcome_module_already_disabled"],
@ -391,7 +391,7 @@ class Config(commands.GroupCog, group_name="config"):
guild_config.welcome_message = None guild_config.welcome_message = None
guild_config.push() guild_config.push()
embed: discord.Embed = Builder.create_embed( embed: discord.Embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=interaction.user.name, user_name=interaction.user.name,
author_text=CONST.STRINGS["config_author"], author_text=CONST.STRINGS["config_author"],
description=CONST.STRINGS["config_welcome_module_disabled"], description=CONST.STRINGS["config_welcome_module_disabled"],
@ -417,7 +417,7 @@ class Config(commands.GroupCog, group_name="config"):
guild_config.push() guild_config.push()
embed: discord.Embed = Builder.create_embed( embed: discord.Embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=interaction.user.name, user_name=interaction.user.name,
author_text=CONST.STRINGS["config_author"], author_text=CONST.STRINGS["config_author"],
description=CONST.STRINGS["config_welcome_template_updated"], description=CONST.STRINGS["config_welcome_template_updated"],
@ -456,7 +456,7 @@ class Config(commands.GroupCog, group_name="config"):
guild_config.push() guild_config.push()
embed = Builder.create_embed( embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=interaction.user.name, user_name=interaction.user.name,
author_text=CONST.STRINGS["config_author"], author_text=CONST.STRINGS["config_author"],
description=CONST.STRINGS["config_level_current_channel_set"], description=CONST.STRINGS["config_level_current_channel_set"],
@ -483,7 +483,7 @@ class Config(commands.GroupCog, group_name="config"):
guild_config.push() guild_config.push()
embed = Builder.create_embed( embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=interaction.user.name, user_name=interaction.user.name,
author_text=CONST.STRINGS["config_author"], author_text=CONST.STRINGS["config_author"],
description=CONST.STRINGS["config_level_module_disabled"], description=CONST.STRINGS["config_level_module_disabled"],
@ -506,7 +506,7 @@ class Config(commands.GroupCog, group_name="config"):
if guild_config.level_message_type != 0: if guild_config.level_message_type != 0:
embed = Builder.create_embed( embed = Builder.create_embed(
theme="info", Builder.INFO,
user_name=interaction.user.name, user_name=interaction.user.name,
author_text=CONST.STRINGS["config_author"], author_text=CONST.STRINGS["config_author"],
description=CONST.STRINGS["config_level_module_already_enabled"], description=CONST.STRINGS["config_level_module_already_enabled"],
@ -515,7 +515,7 @@ class Config(commands.GroupCog, group_name="config"):
guild_config.level_message_type = 1 guild_config.level_message_type = 1
guild_config.push() guild_config.push()
embed = Builder.create_embed( embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=interaction.user.name, user_name=interaction.user.name,
author_text=CONST.STRINGS["config_author"], author_text=CONST.STRINGS["config_author"],
description=CONST.STRINGS["config_level_module_enabled"], description=CONST.STRINGS["config_level_module_enabled"],
@ -543,7 +543,7 @@ class Config(commands.GroupCog, group_name="config"):
preview = lib.format.template(text, "Lucas", 15) preview = lib.format.template(text, "Lucas", 15)
embed = Builder.create_embed( embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=interaction.user.name, user_name=interaction.user.name,
author_text=CONST.STRINGS["config_author"], author_text=CONST.STRINGS["config_author"],
description=CONST.STRINGS["config_level_template_updated"], description=CONST.STRINGS["config_level_template_updated"],
@ -580,7 +580,7 @@ class Config(commands.GroupCog, group_name="config"):
guild_config = GuildConfig(interaction.guild.id) guild_config = GuildConfig(interaction.guild.id)
embed = Builder.create_embed( embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=interaction.user.name, user_name=interaction.user.name,
author_text=CONST.STRINGS["config_author"], author_text=CONST.STRINGS["config_author"],
) )
@ -625,7 +625,7 @@ class Config(commands.GroupCog, group_name="config"):
mod_log = ModLogService() mod_log = ModLogService()
info_embed = Builder.create_embed( info_embed = Builder.create_embed(
theme="info", Builder.INFO,
user_name=interaction.user.name, user_name=interaction.user.name,
author_text=CONST.STRINGS["config_modlog_info_author"], author_text=CONST.STRINGS["config_modlog_info_author"],
description=CONST.STRINGS["config_modlog_info_description"].format( description=CONST.STRINGS["config_modlog_info_description"].format(
@ -652,7 +652,7 @@ class Config(commands.GroupCog, group_name="config"):
mod_log.set_modlog_channel(interaction.guild.id, channel.id) mod_log.set_modlog_channel(interaction.guild.id, channel.id)
success_embed = Builder.create_embed( success_embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=interaction.user.name, user_name=interaction.user.name,
author_text=CONST.STRINGS["config_author"], author_text=CONST.STRINGS["config_author"],
description=CONST.STRINGS["config_modlog_channel_set"].format(channel.mention), description=CONST.STRINGS["config_modlog_channel_set"].format(channel.mention),
@ -675,7 +675,7 @@ class Config(commands.GroupCog, group_name="config"):
assert interaction.guild assert interaction.guild
if len(prefix) > 25: if len(prefix) > 25:
embed = Builder.create_embed( embed = Builder.create_embed(
theme="error", Builder.ERROR,
user_name=interaction.user.name, user_name=interaction.user.name,
author_text=CONST.STRINGS["config_author"], author_text=CONST.STRINGS["config_author"],
description=CONST.STRINGS["config_prefix_too_long"], description=CONST.STRINGS["config_prefix_too_long"],
@ -687,7 +687,7 @@ class Config(commands.GroupCog, group_name="config"):
GuildConfig.set_prefix(guild_config.guild_id, prefix) GuildConfig.set_prefix(guild_config.guild_id, prefix)
embed = Builder.create_embed( embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=interaction.user.name, user_name=interaction.user.name,
author_text=CONST.STRINGS["config_author"], author_text=CONST.STRINGS["config_author"],
description=CONST.STRINGS["config_prefix_set"].format(prefix), description=CONST.STRINGS["config_prefix_set"].format(prefix),
@ -709,7 +709,7 @@ class Config(commands.GroupCog, group_name="config"):
level_reward = XpRewardService(interaction.guild.id) level_reward = XpRewardService(interaction.guild.id)
embed = Builder.create_embed( embed = Builder.create_embed(
theme="info", Builder.INFO,
user_name=interaction.user.name, user_name=interaction.user.name,
author_text="Level Rewards", author_text="Level Rewards",
thumbnail_url=interaction.guild.icon.url if interaction.guild.icon else CONST.LUMI_LOGO_OPAQUE, thumbnail_url=interaction.guild.icon.url if interaction.guild.icon else CONST.LUMI_LOGO_OPAQUE,
@ -760,7 +760,7 @@ class Config(commands.GroupCog, group_name="config"):
level_reward.add_reward(level, role.id, persistent) level_reward.add_reward(level, role.id, persistent)
embed = Builder.create_embed( embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=interaction.user.name, user_name=interaction.user.name,
author_text=CONST.STRINGS["config_author"], author_text=CONST.STRINGS["config_author"],
description=CONST.STRINGS["config_xpreward_added"].format(level, role.mention), description=CONST.STRINGS["config_xpreward_added"].format(level, role.mention),
@ -785,7 +785,7 @@ class Config(commands.GroupCog, group_name="config"):
level_reward.remove_reward(level) level_reward.remove_reward(level)
embed = Builder.create_embed( embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=interaction.user.name, user_name=interaction.user.name,
author_text=CONST.STRINGS["config_author"], author_text=CONST.STRINGS["config_author"],
description=CONST.STRINGS["config_xpreward_removed"].format(level), description=CONST.STRINGS["config_xpreward_removed"].format(level),

View file

@ -34,7 +34,7 @@ class Balance(commands.Cog):
balance = Currency.format(ctx_currency.balance) balance = Currency.format(ctx_currency.balance)
embed = Builder.create_embed( embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=ctx.author.name, user_name=ctx.author.name,
author_text=CONST.STRINGS["balance_author"].format(ctx.author.name), author_text=CONST.STRINGS["balance_author"].format(ctx.author.name),
author_icon_url=ctx.author.display_avatar.url, author_icon_url=ctx.author.display_avatar.url,

View file

@ -199,7 +199,7 @@ class Blackjack(commands.Cog):
) )
return Builder.create_embed( return Builder.create_embed(
theme="default", Builder.DEFAULT,
user_name=ctx.author.name, user_name=ctx.author.name,
title=CONST.STRINGS["blackjack_title"], title=CONST.STRINGS["blackjack_title"],
description=description, description=description,
@ -218,7 +218,7 @@ class Blackjack(commands.Cog):
status: int, status: int,
) -> discord.Embed: ) -> discord.Embed:
embed = Builder.create_embed( embed = Builder.create_embed(
theme="default", Builder.DEFAULT,
user_name=ctx.author.name, user_name=ctx.author.name,
title=CONST.STRINGS["blackjack_title"], title=CONST.STRINGS["blackjack_title"],
description=CONST.STRINGS["blackjack_description"].format( description=CONST.STRINGS["blackjack_description"].format(

View file

@ -52,7 +52,7 @@ class Daily(commands.Cog):
wait_time: datetime = datetime.now(tz) + timedelta(seconds=seconds_until(7, 0)) wait_time: datetime = datetime.now(tz) + timedelta(seconds=seconds_until(7, 0))
unix_time: int = int(round(wait_time.timestamp())) unix_time: int = int(round(wait_time.timestamp()))
error_embed: Embed = Builder.create_embed( error_embed: Embed = Builder.create_embed(
theme="error", Builder.ERROR,
user_name=ctx.author.name, user_name=ctx.author.name,
author_text=CONST.STRINGS["daily_already_claimed_author"], author_text=CONST.STRINGS["daily_already_claimed_author"],
description=CONST.STRINGS["daily_already_claimed_description"].format( description=CONST.STRINGS["daily_already_claimed_description"].format(
@ -70,7 +70,7 @@ class Daily(commands.Cog):
ctx_daily.refresh() ctx_daily.refresh()
embed: Embed = Builder.create_embed( embed: Embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=ctx.author.name, user_name=ctx.author.name,
author_text=CONST.STRINGS["daily_success_claim_author"], author_text=CONST.STRINGS["daily_success_claim_author"],
description=CONST.STRINGS["daily_success_claim_description"].format( description=CONST.STRINGS["daily_success_claim_description"].format(

View file

@ -56,7 +56,7 @@ class Give(commands.Cog):
target_currency.push() target_currency.push()
embed = Builder.create_embed( embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=ctx.author.name, user_name=ctx.author.name,
description=CONST.STRINGS["give_success"].format( description=CONST.STRINGS["give_success"].format(
Currency.format(amount), Currency.format(amount),

View file

@ -37,7 +37,7 @@ class Leaderboard(commands.Cog):
author: Member = cast(Member, ctx.author) author: Member = cast(Member, ctx.author)
embed: Embed = Builder.create_embed( embed: Embed = Builder.create_embed(
theme="info", Builder.INFO,
user_name=author.name, user_name=author.name,
thumbnail_url=author.display_avatar.url, thumbnail_url=author.display_avatar.url,
hide_name_in_description=True, hide_name_in_description=True,

View file

@ -37,7 +37,7 @@ class Level(commands.Cog):
) )
embed: Embed = Builder.create_embed( embed: Embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=ctx.author.name, user_name=ctx.author.name,
title=CONST.STRINGS["xp_level"].format(xp_data.level), title=CONST.STRINGS["xp_level"].format(xp_data.level),
footer_text=CONST.STRINGS["xp_server_rank"].format(rank or "NaN"), footer_text=CONST.STRINGS["xp_server_rank"].format(rank or "NaN"),

View file

@ -34,7 +34,7 @@ class Info(commands.Cog):
) )
embed: discord.Embed = Builder.create_embed( embed: discord.Embed = Builder.create_embed(
theme="info", Builder.INFO,
user_name=ctx.author.name, user_name=ctx.author.name,
author_text=f"{CONST.TITLE} v{CONST.VERSION}", author_text=f"{CONST.TITLE} v{CONST.VERSION}",
author_url=CONST.REPO_URL, author_url=CONST.REPO_URL,

View file

@ -34,7 +34,7 @@ class Introduction(commands.Cog):
if not guild or not member: if not guild or not member:
await ctx.send( await ctx.send(
embed=Builder.create_embed( embed=Builder.create_embed(
theme="error", Builder.ERROR,
user_name=ctx.author.name, user_name=ctx.author.name,
author_text=CONST.STRINGS["intro_no_guild_author"], author_text=CONST.STRINGS["intro_no_guild_author"],
description=CONST.STRINGS["intro_no_guild"], description=CONST.STRINGS["intro_no_guild"],
@ -54,7 +54,7 @@ class Introduction(commands.Cog):
): ):
await ctx.send( await ctx.send(
embed=Builder.create_embed( embed=Builder.create_embed(
theme="error", Builder.ERROR,
user_name=ctx.author.name, user_name=ctx.author.name,
author_text=CONST.STRINGS["intro_no_channel_author"], author_text=CONST.STRINGS["intro_no_channel_author"],
description=CONST.STRINGS["intro_no_channel"], description=CONST.STRINGS["intro_no_channel"],
@ -66,7 +66,7 @@ class Introduction(commands.Cog):
view: IntroductionStartButtons | IntroductionFinishButtons = IntroductionStartButtons(ctx) view: IntroductionStartButtons | IntroductionFinishButtons = IntroductionStartButtons(ctx)
await ctx.send( await ctx.send(
embed=Builder.create_embed( embed=Builder.create_embed(
theme="info", Builder.INFO,
user_name=ctx.author.name, user_name=ctx.author.name,
author_text=CONST.STRINGS["intro_service_name"], author_text=CONST.STRINGS["intro_service_name"],
description=CONST.STRINGS["intro_start"].format(channel.mention), description=CONST.STRINGS["intro_start"].format(channel.mention),
@ -80,7 +80,7 @@ class Introduction(commands.Cog):
if view.clicked_stop: if view.clicked_stop:
await ctx.send( await ctx.send(
embed=Builder.create_embed( embed=Builder.create_embed(
theme="error", Builder.ERROR,
user_name=ctx.author.name, user_name=ctx.author.name,
author_text=CONST.STRINGS["intro_stopped_author"], author_text=CONST.STRINGS["intro_stopped_author"],
description=CONST.STRINGS["intro_stopped"], description=CONST.STRINGS["intro_stopped"],
@ -102,7 +102,7 @@ class Introduction(commands.Cog):
for key, question in question_mapping.items(): for key, question in question_mapping.items():
await ctx.send( await ctx.send(
embed=Builder.create_embed( embed=Builder.create_embed(
theme="info", Builder.INFO,
user_name=ctx.author.name, user_name=ctx.author.name,
author_text=key, author_text=key,
description=question, description=question,
@ -121,7 +121,7 @@ class Introduction(commands.Cog):
if len(answer_content) > 200: if len(answer_content) > 200:
await ctx.send( await ctx.send(
embed=Builder.create_embed( embed=Builder.create_embed(
theme="error", Builder.ERROR,
user_name=ctx.author.name, user_name=ctx.author.name,
author_text=CONST.STRINGS["intro_too_long_author"], author_text=CONST.STRINGS["intro_too_long_author"],
description=CONST.STRINGS["intro_too_long"], description=CONST.STRINGS["intro_too_long"],
@ -135,7 +135,7 @@ class Introduction(commands.Cog):
except TimeoutError: except TimeoutError:
await ctx.send( await ctx.send(
embed=Builder.create_embed( embed=Builder.create_embed(
theme="error", Builder.ERROR,
user_name=ctx.author.name, user_name=ctx.author.name,
author_text=CONST.STRINGS["intro_timeout_author"], author_text=CONST.STRINGS["intro_timeout_author"],
description=CONST.STRINGS["intro_timeout"], description=CONST.STRINGS["intro_timeout"],
@ -149,7 +149,7 @@ class Introduction(commands.Cog):
) )
preview: discord.Embed = Builder.create_embed( preview: discord.Embed = Builder.create_embed(
theme="info", Builder.INFO,
user_name=ctx.author.name, user_name=ctx.author.name,
author_text=ctx.author.name, author_text=ctx.author.name,
author_icon_url=ctx.author.display_avatar.url, author_icon_url=ctx.author.display_avatar.url,
@ -169,7 +169,7 @@ class Introduction(commands.Cog):
) )
await ctx.send( await ctx.send(
embed=Builder.create_embed( embed=Builder.create_embed(
theme="info", Builder.INFO,
user_name=ctx.author.name, user_name=ctx.author.name,
author_text=CONST.STRINGS["intro_post_confirmation_author"], author_text=CONST.STRINGS["intro_post_confirmation_author"],
description=CONST.STRINGS["intro_post_confirmation"].format( description=CONST.STRINGS["intro_post_confirmation"].format(
@ -180,7 +180,7 @@ class Introduction(commands.Cog):
else: else:
await ctx.send( await ctx.send(
embed=Builder.create_embed( embed=Builder.create_embed(
theme="error", Builder.ERROR,
user_name=ctx.author.name, user_name=ctx.author.name,
author_text=CONST.STRINGS["intro_stopped_author"], author_text=CONST.STRINGS["intro_stopped_author"],
description=CONST.STRINGS["intro_stopped"], description=CONST.STRINGS["intro_stopped"],

View file

@ -24,7 +24,7 @@ class Invite(commands.Cog):
""" """
await ctx.send( await ctx.send(
embed=Builder.create_embed( embed=Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=ctx.author.name, user_name=ctx.author.name,
author_text=CONST.STRINGS["invite_author"], author_text=CONST.STRINGS["invite_author"],
description=CONST.STRINGS["invite_description"], description=CONST.STRINGS["invite_description"],

View file

@ -22,7 +22,7 @@ class Ping(commands.Cog):
The context of the command. The context of the command.
""" """
embed = Builder.create_embed( embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=ctx.author.name, user_name=ctx.author.name,
author_text=CONST.STRINGS["ping_author"], author_text=CONST.STRINGS["ping_author"],
description=CONST.STRINGS["ping_pong"], description=CONST.STRINGS["ping_pong"],

View file

@ -29,7 +29,7 @@ class Uptime(commands.Cog):
unix_timestamp: int = int(self.start_time.timestamp()) unix_timestamp: int = int(self.start_time.timestamp())
embed: Embed = Builder.create_embed( embed: Embed = Builder.create_embed(
theme="info", Builder.INFO,
user_name=ctx.author.name, user_name=ctx.author.name,
author_text=CONST.STRINGS["ping_author"], author_text=CONST.STRINGS["ping_author"],
description=CONST.STRINGS["ping_uptime"].format(unix_timestamp), description=CONST.STRINGS["ping_uptime"].format(unix_timestamp),

View file

@ -25,7 +25,7 @@ async def print_comic(
await interaction.response.send_message( await interaction.response.send_message(
embed=Builder.create_embed( embed=Builder.create_embed(
theme="info", Builder.INFO,
author_text=CONST.STRINGS["xkcd_title"].format(comic.id, comic.title), author_text=CONST.STRINGS["xkcd_title"].format(comic.id, comic.title),
description=CONST.STRINGS["xkcd_description"].format( description=CONST.STRINGS["xkcd_description"].format(
comic.explanation_url, comic.explanation_url,
@ -39,7 +39,7 @@ async def print_comic(
except HttpError: except HttpError:
await interaction.response.send_message( await interaction.response.send_message(
embed=Builder.create_embed( embed=Builder.create_embed(
theme="error", Builder.ERROR,
author_text=CONST.STRINGS["xkcd_not_found_author"], author_text=CONST.STRINGS["xkcd_not_found_author"],
description=CONST.STRINGS["xkcd_not_found"], description=CONST.STRINGS["xkcd_not_found"],
footer_text=CONST.STRINGS["xkcd_footer"], footer_text=CONST.STRINGS["xkcd_footer"],

View file

@ -58,7 +58,7 @@ class Ban(commands.Cog):
with contextlib.suppress(discord.HTTPException, discord.Forbidden): with contextlib.suppress(discord.HTTPException, discord.Forbidden):
await target.send( await target.send(
embed=Builder.create_embed( embed=Builder.create_embed(
theme="warning", Builder.WARNING,
user_name=target.name, user_name=target.name,
author_text=CONST.STRINGS["mod_banned_author"], author_text=CONST.STRINGS["mod_banned_author"],
description=CONST.STRINGS["mod_ban_dm"].format( description=CONST.STRINGS["mod_ban_dm"].format(
@ -74,7 +74,7 @@ class Ban(commands.Cog):
await ctx.guild.ban(target, reason=formatted_reason) await ctx.guild.ban(target, reason=formatted_reason)
embed = Builder.create_embed( embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=ctx.author.name, user_name=ctx.author.name,
author_text=CONST.STRINGS["mod_banned_author"], author_text=CONST.STRINGS["mod_banned_author"],
description=CONST.STRINGS["mod_banned_user"].format(target.name), description=CONST.STRINGS["mod_banned_user"].format(target.name),
@ -126,7 +126,7 @@ class Ban(commands.Cog):
respond_task = ctx.send( respond_task = ctx.send(
embed=Builder.create_embed( embed=Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=ctx.author.name, user_name=ctx.author.name,
author_text=CONST.STRINGS["mod_unbanned_author"], author_text=CONST.STRINGS["mod_unbanned_author"],
description=CONST.STRINGS["mod_unbanned"].format(target.name), description=CONST.STRINGS["mod_unbanned"].format(target.name),
@ -138,7 +138,7 @@ class Ban(commands.Cog):
except (discord.NotFound, discord.HTTPException): except (discord.NotFound, discord.HTTPException):
await ctx.send( await ctx.send(
embed=Builder.create_embed( embed=Builder.create_embed(
theme="error", Builder.ERROR,
user_name=ctx.author.name, user_name=ctx.author.name,
author_text=CONST.STRINGS["mod_not_banned_author"], author_text=CONST.STRINGS["mod_not_banned_author"],
description=CONST.STRINGS["mod_not_banned"].format(target.id), description=CONST.STRINGS["mod_not_banned"].format(target.id),

View file

@ -22,7 +22,7 @@ case_service = CaseService()
def create_no_cases_embed(ctx: commands.Context[Luminara], author_text: str, description: str) -> discord.Embed: def create_no_cases_embed(ctx: commands.Context[Luminara], author_text: str, description: str) -> discord.Embed:
return Builder.create_embed( return Builder.create_embed(
theme="info", Builder.INFO,
user_name=ctx.author.name, user_name=ctx.author.name,
author_text=author_text, author_text=author_text,
description=description, description=description,
@ -216,7 +216,7 @@ class Cases(commands.Cog):
) )
embed = Builder.create_embed( embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=ctx.author.name, user_name=ctx.author.name,
author_text=CONST.STRINGS["case_reason_update_author"], author_text=CONST.STRINGS["case_reason_update_author"],
description=CONST.STRINGS["case_reason_update_description"].format( description=CONST.STRINGS["case_reason_update_description"].format(

View file

@ -50,7 +50,7 @@ class Kick(commands.Cog):
try: try:
await target.send( await target.send(
embed=Builder.create_embed( embed=Builder.create_embed(
theme="warning", Builder.WARNING,
user_name=target.name, user_name=target.name,
author_text=CONST.STRINGS["mod_kicked_author"], author_text=CONST.STRINGS["mod_kicked_author"],
description=CONST.STRINGS["mod_kick_dm"].format( description=CONST.STRINGS["mod_kick_dm"].format(
@ -75,7 +75,7 @@ class Kick(commands.Cog):
respond_task = ctx.send( respond_task = ctx.send(
embed=Builder.create_embed( embed=Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=ctx.author.name, user_name=ctx.author.name,
author_text=CONST.STRINGS["mod_kicked_author"], author_text=CONST.STRINGS["mod_kicked_author"],
description=CONST.STRINGS["mod_kicked_user"].format(target.name), description=CONST.STRINGS["mod_kicked_user"].format(target.name),

View file

@ -50,7 +50,7 @@ class Softban(commands.Cog):
try: try:
await target.send( await target.send(
embed=Builder.create_embed( embed=Builder.create_embed(
theme="warning", Builder.WARNING,
user_name=target.name, user_name=target.name,
author_text=CONST.STRINGS["mod_softbanned_author"], author_text=CONST.STRINGS["mod_softbanned_author"],
description=CONST.STRINGS["mod_softban_dm"].format( description=CONST.STRINGS["mod_softban_dm"].format(
@ -83,7 +83,7 @@ class Softban(commands.Cog):
respond_task = ctx.send( respond_task = ctx.send(
embed=Builder.create_embed( embed=Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=target.name, user_name=target.name,
author_text=CONST.STRINGS["mod_softbanned_author"], author_text=CONST.STRINGS["mod_softbanned_author"],
description=CONST.STRINGS["mod_softbanned_user"].format(target.name), description=CONST.STRINGS["mod_softbanned_user"].format(target.name),

View file

@ -70,7 +70,7 @@ class Timeout(commands.Cog):
dm_task = target.send( dm_task = target.send(
embed=Builder.create_embed( embed=Builder.create_embed(
theme="warning", Builder.WARNING,
user_name=target.name, user_name=target.name,
author_text=CONST.STRINGS["mod_timed_out_author"], author_text=CONST.STRINGS["mod_timed_out_author"],
description=CONST.STRINGS["mod_timeout_dm"].format( description=CONST.STRINGS["mod_timeout_dm"].format(
@ -85,7 +85,7 @@ class Timeout(commands.Cog):
respond_task = ctx.send( respond_task = ctx.send(
embed=Builder.create_embed( embed=Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=target.name, user_name=target.name,
author_text=CONST.STRINGS["mod_timed_out_author"], author_text=CONST.STRINGS["mod_timed_out_author"],
description=CONST.STRINGS["mod_timed_out_user"].format(target.name), description=CONST.STRINGS["mod_timed_out_user"].format(target.name),
@ -138,7 +138,7 @@ class Timeout(commands.Cog):
respond_task = ctx.send( respond_task = ctx.send(
embed=Builder.create_embed( embed=Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=ctx.author.name, user_name=ctx.author.name,
author_text=CONST.STRINGS["mod_untimed_out_author"], author_text=CONST.STRINGS["mod_untimed_out_author"],
description=CONST.STRINGS["mod_untimed_out"].format(target.name), description=CONST.STRINGS["mod_untimed_out"].format(target.name),
@ -152,7 +152,7 @@ class Timeout(commands.Cog):
except discord.HTTPException: except discord.HTTPException:
await ctx.send( await ctx.send(
embed=Builder.create_embed( embed=Builder.create_embed(
theme="warning", Builder.WARNING,
user_name=ctx.author.name, user_name=ctx.author.name,
author_text=CONST.STRINGS["mod_not_timed_out_author"], author_text=CONST.STRINGS["mod_not_timed_out_author"],
description=CONST.STRINGS["mod_not_timed_out"].format(target.name), description=CONST.STRINGS["mod_not_timed_out"].format(target.name),

View file

@ -48,7 +48,7 @@ class Warn(commands.Cog):
dm_task = target.send( dm_task = target.send(
embed=Builder.create_embed( embed=Builder.create_embed(
theme="info", Builder.INFO,
user_name=target.name, user_name=target.name,
author_text=CONST.STRINGS["mod_warned_author"], author_text=CONST.STRINGS["mod_warned_author"],
description=CONST.STRINGS["mod_warn_dm"].format( description=CONST.STRINGS["mod_warn_dm"].format(
@ -62,7 +62,7 @@ class Warn(commands.Cog):
respond_task = ctx.send( respond_task = ctx.send(
embed=Builder.create_embed( embed=Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=ctx.author.name, user_name=ctx.author.name,
author_text=CONST.STRINGS["mod_warned_author"], author_text=CONST.STRINGS["mod_warned_author"],
description=CONST.STRINGS["mod_warned_user"].format(target.name), description=CONST.STRINGS["mod_warned_user"].format(target.name),

View file

@ -77,7 +77,7 @@ class Triggers(commands.GroupCog, group_name="trigger"):
raise LumiException(CONST.STRINGS["triggers_not_added"]) raise LumiException(CONST.STRINGS["triggers_not_added"])
embed = Builder.create_embed( embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=interaction.user.name, user_name=interaction.user.name,
author_text=CONST.STRINGS["triggers_add_author"], author_text=CONST.STRINGS["triggers_add_author"],
description="", description="",
@ -141,7 +141,7 @@ class Triggers(commands.GroupCog, group_name="trigger"):
raise LumiException(CONST.STRINGS["triggers_not_added"]) raise LumiException(CONST.STRINGS["triggers_not_added"])
embed = Builder.create_embed( embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=interaction.user.name, user_name=interaction.user.name,
author_text=CONST.STRINGS["triggers_add_author"], author_text=CONST.STRINGS["triggers_add_author"],
description="", description="",
@ -184,7 +184,7 @@ class Triggers(commands.GroupCog, group_name="trigger"):
await reaction_service.delete_custom_reaction(reaction_id) await reaction_service.delete_custom_reaction(reaction_id)
embed = Builder.create_embed( embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=interaction.user.name, user_name=interaction.user.name,
author_text=CONST.STRINGS["triggers_delete_author"], author_text=CONST.STRINGS["triggers_delete_author"],
description=CONST.STRINGS["triggers_delete_description"], description=CONST.STRINGS["triggers_delete_description"],
@ -210,7 +210,7 @@ class Triggers(commands.GroupCog, group_name="trigger"):
reactions: list[dict[str, Any]] = await reaction_service.find_all_by_guild(guild_id) reactions: list[dict[str, Any]] = await reaction_service.find_all_by_guild(guild_id)
if not reactions: if not reactions:
embed: discord.Embed = Builder.create_embed( embed: discord.Embed = Builder.create_embed(
theme="warning", Builder.WARNING,
user_name=interaction.user.name, user_name=interaction.user.name,
author_text=CONST.STRINGS["triggers_no_reactions_title"], author_text=CONST.STRINGS["triggers_no_reactions_title"],
description=CONST.STRINGS["triggers_no_reactions_description"], description=CONST.STRINGS["triggers_no_reactions_description"],
@ -224,7 +224,7 @@ class Triggers(commands.GroupCog, group_name="trigger"):
for reaction in reactions: for reaction in reactions:
embed: discord.Embed = Builder.create_embed( embed: discord.Embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=interaction.user.name, user_name=interaction.user.name,
title=CONST.STRINGS["triggers_list_custom_reaction_id"].format( title=CONST.STRINGS["triggers_list_custom_reaction_id"].format(
reaction["id"], reaction["id"],

View file

@ -20,7 +20,7 @@ def create_case_embed(
duration: int | None = None, duration: int | None = None,
) -> discord.Embed: ) -> discord.Embed:
embed: discord.Embed = Builder.create_embed( embed: discord.Embed = Builder.create_embed(
theme="info", Builder.INFO,
user_name=ctx.author.name, user_name=ctx.author.name,
author_text=CONST.STRINGS["case_new_case_author"], author_text=CONST.STRINGS["case_new_case_author"],
thumbnail_url=target.display_avatar.url, thumbnail_url=target.display_avatar.url,
@ -82,7 +82,7 @@ def create_case_list_embed(
author_text: str, author_text: str,
) -> discord.Embed: ) -> discord.Embed:
embed: discord.Embed = Builder.create_embed( embed: discord.Embed = Builder.create_embed(
theme="info", Builder.INFO,
user_name=ctx.author.name, user_name=ctx.author.name,
author_text=author_text, author_text=author_text,
hide_name_in_description=True, hide_name_in_description=True,

View file

@ -1,15 +1,29 @@
from datetime import datetime from datetime import datetime
from typing import Literal from enum import Enum
import discord import discord
from lib.const import CONST from lib.const import CONST
class Theme(Enum):
ERROR = "error"
SUCCESS = "success"
INFO = "info"
WARNING = "warning"
DEFAULT = "default"
class Builder: class Builder:
ERROR = Theme.ERROR
SUCCESS = Theme.SUCCESS
INFO = Theme.INFO
WARNING = Theme.WARNING
DEFAULT = Theme.DEFAULT
@staticmethod @staticmethod
def create_embed( def create_embed(
theme: Literal["error", "success", "info", "warning", "default"], theme: Theme,
user_name: str | None = None, user_name: str | None = None,
user_display_avatar_url: str | None = None, user_display_avatar_url: str | None = None,
title: str | None = None, title: str | None = None,
@ -29,38 +43,34 @@ class Builder:
""" """
Create a standard Lumi embed with the given parameters. Create a standard Lumi embed with the given parameters.
""" """
theme_settings = { theme_settings = {
"error": (CONST.COLOR_ERROR, CONST.CROSS_ICON), Theme.ERROR: (CONST.COLOR_ERROR, CONST.CROSS_ICON),
"success": (CONST.COLOR_DEFAULT, CONST.CHECK_ICON), Theme.SUCCESS: (CONST.COLOR_DEFAULT, CONST.CHECK_ICON),
"info": (CONST.COLOR_DEFAULT, CONST.INFO_ICON), Theme.INFO: (CONST.COLOR_DEFAULT, CONST.INFO_ICON),
"warning": (CONST.COLOR_WARNING, CONST.WARNING_ICON), Theme.WARNING: (CONST.COLOR_WARNING, CONST.WARNING_ICON),
"default": (color or CONST.COLOR_DEFAULT, None), Theme.DEFAULT: (color or CONST.COLOR_DEFAULT, None),
} }
color, author_icon_url = theme_settings[theme] embed_color, theme_icon = theme_settings[theme]
if user_name and not hide_name_in_description: if user_name and not hide_name_in_description:
description = f"**{user_name}** {description}" description = f"**{user_name}** {description or ''}"
embed: discord.Embed = discord.Embed( embed = discord.Embed(
title=title, title=title,
description=description, description=description,
color=color, color=embed_color,
timestamp=None if hide_time else (timestamp or discord.utils.utcnow()),
) )
embed.set_author( embed.set_author(
name=author_text or user_name or None, name=author_text or user_name,
icon_url=author_icon_url or user_display_avatar_url or None, icon_url=author_icon_url or theme_icon or user_display_avatar_url,
url=author_url, url=author_url,
) )
embed.set_footer( embed.set_footer(text=footer_text or CONST.TITLE, icon_url=footer_icon_url or CONST.LUMI_LOGO_TRANSPARENT)
text=footer_text or CONST.TITLE,
icon_url=footer_icon_url or CONST.LUMI_LOGO_TRANSPARENT,
)
embed.timestamp = None if hide_time else (timestamp or discord.utils.utcnow())
if image_url: if image_url:
embed.set_image(url=image_url) embed.set_image(url=image_url)
if thumbnail_url: if thumbnail_url:

View file

@ -78,7 +78,7 @@ class LeaderboardCommandView(discord.ui.View):
async def interaction_check(self, interaction: discord.Interaction) -> bool: async def interaction_check(self, interaction: discord.Interaction) -> bool:
if interaction.user and interaction.user != self.ctx.author: if interaction.user and interaction.user != self.ctx.author:
embed = Builder.create_embed( embed = Builder.create_embed(
theme="error", Builder.ERROR,
user_name=interaction.user.name, user_name=interaction.user.name,
description=CONST.STRINGS["xp_lb_cant_use_dropdown"], description=CONST.STRINGS["xp_lb_cant_use_dropdown"],
hide_name_in_description=True, hide_name_in_description=True,
@ -92,7 +92,7 @@ class LeaderboardCommandView(discord.ui.View):
return return
embed = Builder.create_embed( embed = Builder.create_embed(
theme="success", Builder.SUCCESS,
user_name=interaction.user.name, user_name=interaction.user.name,
thumbnail_url=CONST.FLOWERS_ART, thumbnail_url=CONST.FLOWERS_ART,
hide_name_in_description=True, hide_name_in_description=True,