-
Notifications
You must be signed in to change notification settings - Fork 1
/
embed.py
34 lines (26 loc) · 868 Bytes
/
embed.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import discord
import datetime
import enum
class embedColours(enum.Enum):
red = 0xB30012
orange = 0xFF7B00
light_green = 0x1DBF38
yellow = 0xEBEB07
dark_blue = 0x1D58BF
magenta = 0xA832A4
# Creates an embed object
def create_embed(title: str, description: str, colour: str, footer="contact"):
message = discord.Embed(
title=title,
description=description,
colour=embedColours[colour].value,
timestamp=datetime.datetime.utcnow(),
)
if footer == "contact":
message.set_footer(text="Contact JZ#7252 with concerns.")
else:
message.set_footer(text=footer)
return message
# Adds a field to a message
def add_field(embed: discord.embeds.Embed, title: str, value: str, inline: bool):
embed.add_field(name=title, value=value, inline=inline)