Add utilities.embeds
This commit is contained in:
parent
0335b32673
commit
933f4ade43
21
utilities/embeds.py
Normal file
21
utilities/embeds.py
Normal file
@ -0,0 +1,21 @@
|
||||
import discord
|
||||
from helpers import IMAGES, PD_SEASON, SBA_COLOR
|
||||
|
||||
|
||||
def image_embed(image_url: str, title: str = None, color: str = None, desc: str = None, author_name: str = None, author_icon: str = None):
|
||||
embed_color = int(SBA_COLOR, 16)
|
||||
if color is not None:
|
||||
embed_color = int(color, 16)
|
||||
|
||||
embed = discord.Embed(color=embed_color)
|
||||
|
||||
if title is not None:
|
||||
embed.title = title
|
||||
if desc is not None:
|
||||
embed.description = desc
|
||||
if author_name is not None:
|
||||
icon = author_icon if author_icon is not None else IMAGES['logo']
|
||||
embed.set_author(name=author_name, icon_url=icon)
|
||||
embed.set_footer(text=f'Paper Dynasty Season {PD_SEASON}', icon_url=IMAGES['logo'])
|
||||
embed.set_image(url=image_url)
|
||||
return embed
|
||||
Loading…
Reference in New Issue
Block a user