Add support for webhook embeds

This commit is contained in:
2023-01-22 23:00:03 +01:00
parent 4bc2a7dc6f
commit 269948303e
9 changed files with 804 additions and 42 deletions

View File

@ -7,7 +7,15 @@ from reader import Entry, Reader, TagNotFoundError, make_reader # type: ignore
data_dir: str = user_data_dir(appname="discord_rss_bot", appauthor="TheLovinator", roaming=True)
os.makedirs(data_dir, exist_ok=True)
# TODO: Add default things to the database and make the edible.
default_custom_message: str = "{{entry_title}}\n{{entry_link}}"
default_custom_embed = {
"title": "{{entry_title}}",
"description": "{{entry_content}}",
"url": "{{entry_link}}",
"image": "{{entry_image}}",
"color": 0x008080,
}
def get_webhook_for_entry(custom_reader: Reader, entry: Entry) -> str: