move send_simple above DataFile

This commit is contained in:
MarkusRost 2022-11-10 15:39:29 +01:00
parent 8b95461fd7
commit 08734ce456

View file

@ -46,6 +46,14 @@ WIKI_JUST_DOMAIN: str = ""
profile_fields = {"profile-location": _("Location"), "profile-aboutme": _("About me"), "profile-link-google": _("Google link"), "profile-link-facebook":_("Facebook link"), "profile-link-twitter": _("Twitter link"), "profile-link-reddit": _("Reddit link"), "profile-link-twitch": _("Twitch link"), "profile-link-psn": _("PSN link"), "profile-link-vk": _("VK link"), "profile-link-xbl": _("XBL link"), "profile-link-steam": _("Steam link"), "profile-link-discord": _("Discord handle"), "profile-link-battlenet": _("Battle.net handle")} profile_fields = {"profile-location": _("Location"), "profile-aboutme": _("About me"), "profile-link-google": _("Google link"), "profile-link-facebook":_("Facebook link"), "profile-link-twitter": _("Twitter link"), "profile-link-reddit": _("Reddit link"), "profile-link-twitch": _("Twitch link"), "profile-link-psn": _("PSN link"), "profile-link-vk": _("VK link"), "profile-link-xbl": _("XBL link"), "profile-link-steam": _("Steam link"), "profile-link-discord": _("Discord handle"), "profile-link-battlenet": _("Battle.net handle")}
def send_simple(msgtype, message, name, avatar):
discord_msg = DiscordMessage("compact", msgtype, settings["webhookURL"], content=message)
discord_msg.set_avatar(avatar)
discord_msg.set_name(name)
messagequeue.resend_msgs()
send_to_discord(discord_msg, meta=DiscordMessageMetadata("POST"))
class DataFile: class DataFile:
"""Data class which instance of is shared by multiple modules to remain consistent and do not cause too many IO operations.""" """Data class which instance of is shared by multiple modules to remain consistent and do not cause too many IO operations."""
def __init__(self): def __init__(self):
@ -307,14 +315,6 @@ def prepare_paths(path: str, dry=False):
prepare_paths(settings["wiki_url"]) prepare_paths(settings["wiki_url"])
def send_simple(msgtype, message, name, avatar):
discord_msg = DiscordMessage("compact", msgtype, settings["webhookURL"], content=message)
discord_msg.set_avatar(avatar)
discord_msg.set_name(name)
messagequeue.resend_msgs()
send_to_discord(discord_msg, meta=DiscordMessageMetadata("POST"))
def run_hooks(hooks, *arguments): def run_hooks(hooks, *arguments):
for hook in hooks: for hook in hooks:
try: try: