from discord_webhook import DiscordWebhook, DiscordEmbed from constants import CONST_GetDiscordWebhookURL def test(): webhookURL = CONST_GetDiscordWebhookURL() webhook = DiscordWebhook(url=webhookURL) # create embed object for webhook embed = DiscordEmbed(title="Your Title", description="Lorem ipsum dolor sit", color=242424) #embed.set_author(name="Author Name", url="author url", icon_url="author icon url") embed.set_author(name="Author Name") #embed.set_image(url="your image url") #embed.set_thumbnail(url="your thumbnail url") #embed.set_footer(text="Embed Footer Text", icon_url="URL of icon") # set timestamp (default is now) accepted types are int, float and datetime embed.set_timestamp() embed.add_embed_field(name="Field 1", value="Lorem ipsum") embed.add_embed_field(name="Field 2", value="dolor sit") webhook.add_embed(embed) response = webhook.execute() a = "b" def notifyGameOnDiscord(game): webhookURL = CONST_GetDiscordWebhookURL() webhook = DiscordWebhook(url=webhookURL) embed = DiscordEmbed(title=game.title, description=game.catalog_description, color=242424) #embed.set_author(name="Author Name") embed.set_timestamp() embed.add_embed_field(name="Regular Price", value=str(round(game.price_regular, 2))) embed.add_embed_field(name="Discounted Price", value=str(round(game.price_discounted, 2))) embed.add_embed_field(name="Discount percentage", value=str(round(game.price_discount_percentage, 2))) embed.set_thumbnail(url=game.thumbnail) embed.set_footer(text=game.nsuid, icon_url="https://cdn-icons-png.flaticon.com/256/871/871377.png") webhook.add_embed(embed) response = webhook.execute() response_reason = response.reason a = "b" def canNotifyTheGame(game): return True