1
Fork 0
mirror of https://github.com/wlinator/luminara.git synced 2024-10-02 22:23:13 +00:00
Lumi/lib/embeds/boost.py
wlinator 705ca32c9f refactor: Improve Boost class embed formatting
Refactor the Boost class in the `boost.py` file to improve the formatting of the embed. The `description` field now includes the name of the member who boosted the server. Additionally, the `set_footer` method has been updated to include the total number of server boosts.
2024-07-15 08:34:24 -04:00

27 lines
802 B
Python

import discord
import lib.formatter
from lib.constants import CONST
class Boost:
@staticmethod
def message(member, template=None, image_url=None):
embed = discord.Embed(
color=discord.Color.nitro_pink(),
title="New Booster",
description=f"Thanks for boosting, **{member.name}**!!",
)
if template:
# REPLACE
embed.description = lib.formatter.template(template, member.name)
embed.set_author(name=member.name, icon_url=member.display_avatar)
embed.set_image(url=image_url if image_url else CONST.BOOST_ICON)
embed.set_footer(
text=f"Total server boosts: {member.guild.premium_subscription_count}",
icon_url=CONST.EXCLAIM_ICON,
)
return embed