mirror of
https://gitlab.com/chicken-riders/RcGcDw.git
synced 2025-02-23 00:24:09 +00:00
Send welcome message (#259)
This commit is contained in:
parent
ab710f5f77
commit
8b95461fd7
|
@ -13,6 +13,7 @@
|
||||||
"avatars": {
|
"avatars": {
|
||||||
"connection_failed": "https://i.imgur.com/2jWQEt1.png",
|
"connection_failed": "https://i.imgur.com/2jWQEt1.png",
|
||||||
"connection_restored": "",
|
"connection_restored": "",
|
||||||
|
"welcome": "",
|
||||||
"no_event": "",
|
"no_event": "",
|
||||||
"embed": "",
|
"embed": "",
|
||||||
"compact": ""
|
"compact": ""
|
||||||
|
|
|
@ -17,6 +17,7 @@ import argparse
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description="Start RcGcDw")
|
parser = argparse.ArgumentParser(description="Start RcGcDw")
|
||||||
parser.add_argument("--test", action='store_true', help="mode used for testing, sends only 5 entries of both rc and discussion changes and sends daily overview")
|
parser.add_argument("--test", action='store_true', help="mode used for testing, sends only 5 entries of both rc and discussion changes and sends daily overview")
|
||||||
|
parser.add_argument("--nowelcome", action='store_true', help="don't send a welcome message when a new data file is created")
|
||||||
parser.add_argument("--settings", default="settings.json", type=argparse.FileType(encoding='utf8'), help="provides a path to settings file (default ./settings.json)")
|
parser.add_argument("--settings", default="settings.json", type=argparse.FileType(encoding='utf8'), help="provides a path to settings file (default ./settings.json)")
|
||||||
command_args, unknown = parser.parse_known_args()
|
command_args, unknown = parser.parse_known_args()
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@ from html.parser import HTMLParser
|
||||||
from urllib.parse import urlparse, urlunparse
|
from urllib.parse import urlparse, urlunparse
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
|
from src.argparser import command_args
|
||||||
from src.configloader import settings
|
from src.configloader import settings
|
||||||
import src.api.util
|
import src.api.util
|
||||||
from src.discord.message import DiscordMessage, DiscordMessageMetadata
|
from src.discord.message import DiscordMessage, DiscordMessageMetadata
|
||||||
|
@ -72,6 +73,9 @@ class DataFile:
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
self.generate_datafile()
|
self.generate_datafile()
|
||||||
misc_logger.info("The data file could not be found. Generating a new one...")
|
misc_logger.info("The data file could not be found. Generating a new one...")
|
||||||
|
if not command_args.nowelcome:
|
||||||
|
send_simple("welcome", _("RcGcDw is now running and checking {wiki}.").format(wiki=settings["wikiname"]),
|
||||||
|
_("Welcome"), settings["avatars"].get("welcome", ""))
|
||||||
return data_template
|
return data_template
|
||||||
|
|
||||||
def save_datafile(self):
|
def save_datafile(self):
|
||||||
|
|
Loading…
Reference in a new issue