diff --git a/README.md b/README.md index 0a579d3..d7868bf 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Explanation for settings: `show_updown_messages` – bool value, depending on this settings the messages whenever the wiki goes up and down will be sent to the channel `appearience` – section with different types of actions and logs, and corresponding to them colors/icons. In here you can set custom icon or color! `overview` – bool value, sends a day overview to the channel if true -`overview_UTC_time` – UTC time at which the day overview will be sent +`overview_time` – **local machine time** at which the day overview will be sent ### How to use ### Make sure you have installed all of dependencies and **filled settings.json properly**. You can also use `pip install -r requirements.txt` to install dependencies automatically. If you are using Raspberry Pi you won't have newest Python version installed, you can use [this guide](https://gist.github.com/dschep/24aa61672a2092246eaca2824400d37f). diff --git a/rcgcdw.py b/rcgcdw.py index 37aa49f..bca456c 100644 --- a/rcgcdw.py +++ b/rcgcdw.py @@ -140,7 +140,7 @@ def webhook_formatter(action, STATIC, **params): link = "https://{wiki}.gamepedia.com/{article}".format(wiki=settings["wiki"], article=article_encoded) embed["title"] = _("Deleted redirect {article} by overwriting").format(article=params["title"]) elif action == 14: - link = "https://{wiki}.gamepedia.com/{article}".format(wiki=settings["wiki"], article=params["targetlink"].replace(" ", "_")) + link = "https://{wiki}.gamepedia.com/{article}".format(wiki=settings["wiki"], article=params["target"].replace(" ", "_")) params["desc"] = "{supress}. {desc}".format(desc=params["desc"], supress=_("No redirect has been made") if params["supress"] == True else _("A redirect has been made")) embed["title"] = _("Moved {article} to {target}").format(article = params["title"], target=params["target"]) elif action == 15: @@ -629,10 +629,7 @@ if 1==2: #dummy for future translations print (_("{wiki} is back up!")) if settings["overview"]: - ovUTC_time = (time.strptime(settings["overview_UTC_time"], '%H:%M').tm_hour, time.strptime(settings["overview_UTC_time"], '%H:%M').tm_min) #i don't know what I did there - diff = (datetime.datetime.now().hour - datetime.datetime.utcnow().hour, datetime.datetime.now().minute - datetime.datetime.utcnow().minute) - tim = (ovUTC_time[0]+diff[0], ovUTC_time[1]+diff[1]) - schedule.every().day.at("{}:{}".format(int(math.fabs(tim[0])), int(math.fabs(tim[1])))).do(day_overview) + schedule.every().day.at("{}:{}".format(time.strptime(settings["overview_time"], '%H:%M').tm_hour, time.strptime(settings["overview_time"], '%H:%M').tm_min)).do(day_overview) schedule.every().day.at("00:00").do(recent_changes.clear_cache) while 1: diff --git a/settings.json.example b/settings.json.example index 188524e..69f2386 100644 --- a/settings.json.example +++ b/settings.json.example @@ -17,7 +17,7 @@ "verbose_level": 0, "show_updown_messages": true, "overview": false, - "overview_UTC_time": "00:00", + "overview_time": "00:00", "appearance":{ "daily_overview": { "color": 16312092,