mirror of
https://gitlab.com/chicken-riders/RcGcDw.git
synced 2025-02-23 00:24:09 +00:00
Changed from using problematic UTC time to local machine time when it comes to day overviews for now
This commit is contained in:
parent
941e7de3a7
commit
cca18a0052
|
@ -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).
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue