Remove unneeded function

This commit is contained in:
2023-01-28 21:15:42 +01:00
parent fa061782f4
commit 5a4e56056f
3 changed files with 5 additions and 38 deletions

View File

@ -2,7 +2,7 @@ import os
from functools import lru_cache
from platformdirs import user_data_dir
from reader import Entry, Reader, TagNotFoundError, make_reader # type: ignore
from reader import Reader, 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)
@ -19,30 +19,6 @@ default_custom_embed: dict[str, str] = {
}
def get_webhook_for_entry(custom_reader: Reader, entry: Entry) -> str:
"""
Get the webhook from the database.
Args:
custom_reader: If we should use a custom reader, or the default one.
entry: The entry to get the webhook for.
Returns:
Webhook URL if it has one, returns None if not or error.
"""
# Get the default reader if we didn't get a custom one.
reader: Reader = get_reader() if custom_reader is None else custom_reader
# Get the webhook from the feed.
# Is None if not found or error.
try:
webhook_url: str = str(reader.get_tag(entry.feed_url, "webhook"))
except TagNotFoundError:
webhook_url = ""
return webhook_url
@lru_cache()
def get_db_location(custom_location: str = "") -> str:
"""Where we store the database file.