diff --git a/README.md b/README.md index d7868bf..e7d433f 100644 --- a/README.md +++ b/README.md @@ -12,14 +12,15 @@ Recent changes Gamepedia compatible Discord webhook is a project made from earli * Fetch recent changes from Gamepedia wiki and send them to Discord channel using a webhook * Send day overview, that lists how active was the wiki this day * Can support multiple languages +* Re-sends edits after down-time ### settings.json ### Explanation for settings: `cooldown` – interval for how often changes are retrieved from the wiki (due to used solutions, the real interval is ~1 sec longer) `wiki` – wiki prefix the bot is supposed to work with (for example, for English Minecraft Wiki it's minecraft (https://**minecraft**.gamepedia.com) and for Polish Minecraft Wiki minecraft-pl (https://**minecraft-pl**.gamepedia.com -`lang` – language for the messages, currently available options are: de, en, pl +`lang` – language for the messages, currently available options are: de, en, fr, pl `header` – it's recommended to leave this value as it is, it's a header the script will use to communicate with Gamepedia. Please note that without it, no communication will be possible. -`limit` – amount of actions retrieved every `cooldown` amount of seconds. The higher it is the more network data will be used and the data will be processed longer, setting it to higher values is not recommended, but if you want to make sure no edit is omitted (which only happen if there are more actions in last `cooldown` seconds than this value). +`limit` – amount of actions retrieved every `cooldown` amount of seconds. The higher it is the more network data will be used and the data will be processed longer, setting it to higher values is not recommended unless cooldown value is higher. `webhookURL` – webhook URL you can get using [channel settings in Discord](https://support.discordapp.com/hc/en-us/articles/228383668-Intro-to-Webhooks) `limitrefetch` – limit of how many changes can be retrieved when refetch happens, cannot be lower than limit. -1 if you want to disable auto-refetch `wikiname` – a name of the wiki the bot will work on, required in some messages diff --git a/rcgcdw.py b/rcgcdw.py index bca456c..a99372e 100644 --- a/rcgcdw.py +++ b/rcgcdw.py @@ -508,7 +508,7 @@ def day_overview(): #time.strftime('%Y-%m-%dT%H:%M:%S.000Z', time.gmtime(time.ti active_hours = [_("But nobody came")] numberu, numberh = (0, 0) embed["fields"] = [] - fields = ((_("Most active users"), ', '.join(active_users) + "({})".format(numberu)), (_("Edits made"), edits), (_("New files"), files), (_("Admin actions"), admin), (_("Bytes changed"), changed_bytes), (_("New articles"), new_articles), (_("Unique contributors"), str(len(activity))), (_("Most active hours"), ', '.join(active_hours) + "({})".format(numberh)), (_("Day score"), str(overall))) + fields = ((_("Most active users"), ', '.join(active_users) + " ({})".format(numberu)), (_("Edits made"), edits), (_("New files"), files), (_("Admin actions"), admin), (_("Bytes changed"), changed_bytes), (_("New articles"), new_articles), (_("Unique contributors"), str(len(activity))), (_("Most active hours"), ', '.join(active_hours) + "UTC ({})".format(numberh)), (_("Day score"), str(overall))) for name, value in fields: embed["fields"].append({"name": name, "value": value}) data = {}