diff --git a/rcgcdw.pot b/rcgcdw.pot index f309398..d75b2ee 100644 --- a/rcgcdw.pot +++ b/rcgcdw.pot @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2018-07-08 18:43+0200\n" +"POT-Creation-Date: 2018-07-12 10:57+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -15,385 +15,393 @@ msgstr "" "Generated-By: pygettext.py 1.5\n" -#: rcgcdw.py:126 +#: rcgcdw.py:123 msgid "(N!) " msgstr "" -#: rcgcdw.py:126 +#: rcgcdw.py:123 msgid "m " msgstr "" -#: rcgcdw.py:144 +#: rcgcdw.py:141 msgid "([preview]({link}) | [undo]({undolink}))" msgstr "" -#: rcgcdw.py:144 rcgcdw.py:170 +#: rcgcdw.py:141 rcgcdw.py:167 msgid "Options" msgstr "" -#: rcgcdw.py:145 +#: rcgcdw.py:142 msgid "Uploaded a new version of {name}" msgstr "" -#: rcgcdw.py:147 +#: rcgcdw.py:144 msgid "Uploaded {name}" msgstr "" -#: rcgcdw.py:160 +#: rcgcdw.py:157 msgid "**No license!**" msgstr "" -#: rcgcdw.py:170 +#: rcgcdw.py:167 msgid "([preview]({link}))" msgstr "" -#: rcgcdw.py:171 +#: rcgcdw.py:168 msgid "" "{desc}\n" "License: {license}" msgstr "" -#: rcgcdw.py:174 +#: rcgcdw.py:171 msgid "Deleted page {article}" msgstr "" -#: rcgcdw.py:177 +#: rcgcdw.py:174 msgid "Deleted redirect {article} by overwriting" msgstr "" -#: rcgcdw.py:180 +#: rcgcdw.py:177 msgid "A redirect has been made" msgstr "" -#: rcgcdw.py:180 +#: rcgcdw.py:177 msgid "No redirect has been made" msgstr "" -#: rcgcdw.py:181 +#: rcgcdw.py:178 msgid "Moved {article} to {target}" msgstr "" -#: rcgcdw.py:184 +#: rcgcdw.py:181 msgid "Moved {article} to {title} over redirect" msgstr "" -#: rcgcdw.py:187 +#: rcgcdw.py:184 msgid "Moved protection settings from {article} to {title}" msgstr "" -#: rcgcdw.py:191 +#: rcgcdw.py:188 msgid "infinity and beyond" msgstr "" -#: rcgcdw.py:192 +#: rcgcdw.py:189 msgid "Blocked {blocked_user} for {time}" msgstr "" -#: rcgcdw.py:196 +#: rcgcdw.py:193 msgid "Changed block settings for {blocked_user}" msgstr "" -#: rcgcdw.py:200 +#: rcgcdw.py:197 msgid "Unblocked {blocked_user}" msgstr "" -#: rcgcdw.py:204 +#: rcgcdw.py:201 msgid "Left a comment on {target}'s profile" msgstr "" -#: rcgcdw.py:208 +#: rcgcdw.py:205 msgid "Replied to a comment on {target}'s profile" msgstr "" -#: rcgcdw.py:212 +#: rcgcdw.py:209 msgid "Edited a comment on {target}'s profile" msgstr "" -#: rcgcdw.py:216 +#: rcgcdw.py:213 msgid "Location" msgstr "" -#: rcgcdw.py:218 +#: rcgcdw.py:215 msgid "About me" msgstr "" -#: rcgcdw.py:220 +#: rcgcdw.py:217 msgid "Google link" msgstr "" -#: rcgcdw.py:222 +#: rcgcdw.py:219 msgid "Facebook link" msgstr "" -#: rcgcdw.py:224 +#: rcgcdw.py:221 msgid "Twitter link" msgstr "" -#: rcgcdw.py:226 +#: rcgcdw.py:223 msgid "Reddit link" msgstr "" -#: rcgcdw.py:228 +#: rcgcdw.py:225 msgid "Twitch link" msgstr "" -#: rcgcdw.py:230 +#: rcgcdw.py:227 msgid "PSN link" msgstr "" -#: rcgcdw.py:232 +#: rcgcdw.py:229 msgid "VK link" msgstr "" -#: rcgcdw.py:234 +#: rcgcdw.py:231 msgid "XVL link" msgstr "" -#: rcgcdw.py:236 +#: rcgcdw.py:233 msgid "Steam link" msgstr "" -#: rcgcdw.py:238 +#: rcgcdw.py:235 msgid "Unknown" msgstr "" -#: rcgcdw.py:239 +#: rcgcdw.py:236 msgid "Edited {target}'s profile" msgstr "" -#: rcgcdw.py:240 +#: rcgcdw.py:237 msgid "{field} field changed to: {desc}" msgstr "" -#: rcgcdw.py:244 +#: rcgcdw.py:241 msgid "Deleted a comment on {target}'s profile" msgstr "" -#: rcgcdw.py:247 +#: rcgcdw.py:245 msgid "Changed group membership for {target}" msgstr "" -#: rcgcdw.py:257 rcgcdw.py:259 +#: rcgcdw.py:247 +msgid "System" +msgstr "" + +#: rcgcdw.py:249 +msgid "{target} got autopromoted to a new usergroup" +msgstr "" + +#: rcgcdw.py:259 rcgcdw.py:261 msgid "none" msgstr "" -#: rcgcdw.py:260 rcgcdw.py:381 +#: rcgcdw.py:262 rcgcdw.py:383 msgid "No description provided" msgstr "" -#: rcgcdw.py:261 +#: rcgcdw.py:263 msgid "Groups changed from {old_groups} to {new_groups}{reason}" msgstr "" -#: rcgcdw.py:264 +#: rcgcdw.py:266 msgid "Protected {target}" msgstr "" -#: rcgcdw.py:268 +#: rcgcdw.py:270 msgid "Changed protection level for {article}" msgstr "" -#: rcgcdw.py:272 +#: rcgcdw.py:274 msgid "Removed protection from {article}" msgstr "" -#: rcgcdw.py:275 +#: rcgcdw.py:277 msgid "Changed visibility of revision(s) on page {article} " msgstr "" -#: rcgcdw.py:278 +#: rcgcdw.py:280 msgid "Imported {article} with {count} revision(s)" msgstr "" -#: rcgcdw.py:281 +#: rcgcdw.py:283 msgid "Restored {article}" msgstr "" -#: rcgcdw.py:284 +#: rcgcdw.py:286 msgid "Changed visibility of log events" msgstr "" -#: rcgcdw.py:287 +#: rcgcdw.py:289 msgid "Imported interwiki" msgstr "" -#: rcgcdw.py:290 +#: rcgcdw.py:292 msgid "Edited abuse filter number {number}" msgstr "" -#: rcgcdw.py:293 +#: rcgcdw.py:295 msgid "Merged revision histories of {article} into {dest}" msgstr "" -#: rcgcdw.py:296 +#: rcgcdw.py:298 msgid "Added an entry to the interwiki table" msgstr "" -#: rcgcdw.py:297 rcgcdw.py:301 +#: rcgcdw.py:299 rcgcdw.py:303 msgid "Prefix: {prefix}, website: {website} | {desc}" msgstr "" -#: rcgcdw.py:300 +#: rcgcdw.py:302 msgid "Edited an entry in interwiki table" msgstr "" -#: rcgcdw.py:304 +#: rcgcdw.py:306 msgid "Deleted an entry in interwiki table" msgstr "" -#: rcgcdw.py:305 +#: rcgcdw.py:307 msgid "Prefix: {prefix} | {desc}" msgstr "" -#: rcgcdw.py:308 +#: rcgcdw.py:310 msgid "Changed the content model of the page {article}" msgstr "" -#: rcgcdw.py:309 +#: rcgcdw.py:311 msgid "Model changed from {old} to {new}: {reason}" msgstr "" -#: rcgcdw.py:312 +#: rcgcdw.py:314 msgid "Edited the sprite for {article}" msgstr "" -#: rcgcdw.py:315 +#: rcgcdw.py:317 msgid "Created the sprite sheet for {article}" msgstr "" -#: rcgcdw.py:318 +#: rcgcdw.py:320 msgid "Edited the slice for {article}" msgstr "" -#: rcgcdw.py:321 +#: rcgcdw.py:323 msgid "Created a tag \"{tag}\"" msgstr "" -#: rcgcdw.py:325 +#: rcgcdw.py:327 msgid "Deleted a tag \"{tag}\"" msgstr "" -#: rcgcdw.py:329 +#: rcgcdw.py:331 msgid "Activated a tag \"{tag}\"" msgstr "" -#: rcgcdw.py:332 +#: rcgcdw.py:334 msgid "Deactivated a tag \"{tag}\"" msgstr "" -#: rcgcdw.py:353 +#: rcgcdw.py:355 msgid "Tags" msgstr "" -#: rcgcdw.py:474 +#: rcgcdw.py:478 msgid "Unable to process the event" msgstr "" -#: rcgcdw.py:474 +#: rcgcdw.py:478 msgid "error" msgstr "" -#: rcgcdw.py:554 +#: rcgcdw.py:558 msgid "Daily overview" msgstr "" -#: rcgcdw.py:570 +#: rcgcdw.py:574 msgid " ({} actions)" msgstr "" -#: rcgcdw.py:571 +#: rcgcdw.py:575 msgid " UTC ({} actions)" msgstr "" -#: rcgcdw.py:573 rcgcdw.py:574 +#: rcgcdw.py:577 rcgcdw.py:578 msgid "But nobody came" msgstr "" -#: rcgcdw.py:578 +#: rcgcdw.py:582 msgid "Admin actions" msgstr "" -#: rcgcdw.py:578 +#: rcgcdw.py:582 msgid "Bytes changed" msgstr "" -#: rcgcdw.py:578 +#: rcgcdw.py:582 msgid "Day score" msgstr "" -#: rcgcdw.py:578 +#: rcgcdw.py:582 msgid "Edits made" msgstr "" -#: rcgcdw.py:578 +#: rcgcdw.py:582 msgid "Most active hours" msgstr "" -#: rcgcdw.py:578 +#: rcgcdw.py:582 msgid "Most active users" msgstr "" -#: rcgcdw.py:578 +#: rcgcdw.py:582 msgid "New articles" msgstr "" -#: rcgcdw.py:578 +#: rcgcdw.py:582 msgid "New files" msgstr "" -#: rcgcdw.py:578 +#: rcgcdw.py:582 msgid "Unique contributors" msgstr "" -#: rcgcdw.py:668 +#: rcgcdw.py:672 msgid "Connection to {wiki} seems to be stable now." msgstr "" -#: rcgcdw.py:668 rcgcdw.py:723 +#: rcgcdw.py:672 rcgcdw.py:727 msgid "Connection status" msgstr "" -#: rcgcdw.py:723 +#: rcgcdw.py:727 msgid "{wiki} seems to be down or unreachable." msgstr "" -#: rcgcdw.py:745 +#: rcgcdw.py:749 msgid "autopatrol" msgstr "" -#: rcgcdw.py:745 +#: rcgcdw.py:749 msgid "autoreview" msgstr "" -#: rcgcdw.py:745 +#: rcgcdw.py:749 msgid "bot" msgstr "" -#: rcgcdw.py:745 +#: rcgcdw.py:749 msgid "bureaucrat" msgstr "" -#: rcgcdw.py:745 +#: rcgcdw.py:749 msgid "director" msgstr "" -#: rcgcdw.py:745 +#: rcgcdw.py:749 msgid "directors" msgstr "" -#: rcgcdw.py:745 +#: rcgcdw.py:749 msgid "editor" msgstr "" -#: rcgcdw.py:745 +#: rcgcdw.py:749 msgid "reviewer" msgstr "" -#: rcgcdw.py:745 +#: rcgcdw.py:749 msgid "sysop" msgstr "" -#: rcgcdw.py:745 +#: rcgcdw.py:749 msgid "wiki_guardian" msgstr "" diff --git a/rcgcdw.py b/rcgcdw.py index c03a968..6d465aa 100644 --- a/rcgcdw.py +++ b/rcgcdw.py @@ -104,7 +104,7 @@ def webhook_formatter(action, STATIC, **params): params["user"] = "{author} ({amount})".format(author=params["user"], amount=recent_changes.map_ips[params["user"]]) else: author_url = "https://{wiki}.gamepedia.com/User:{user}".format(wiki=settings["wiki"], user=params["user"].replace(" ", "_")) - if action in (1, 37): #edit or new page + if action in ("edit", "new"): #edit or new page editsize = params["size"] print (editsize) if editsize > 0: @@ -120,8 +120,8 @@ def webhook_formatter(action, STATIC, **params): elif editsize == 0: colornumber = 8750469 link = "https://{wiki}.gamepedia.com/index.php?title={article}&curid={pageid}&diff={diff}&oldid={oldrev}".format(wiki=settings["wiki"], pageid=params["pageid"], diff=params["diff"], oldrev=params["oldrev"], article=params["title"].replace(" ", "_")) - embed["title"] = "{article} ({new}{minor}{editsize})".format(article=params["title"], editsize="+"+str(editsize) if editsize>0 else editsize, new= _("(N!) ") if action == 37 else "", minor=_("m ") if action == 1 and params["minor"] else "") - elif action == 5: #sending files + embed["title"] = "{article} ({new}{minor}{editsize})".format(article=params["title"], editsize="+"+str(editsize) if editsize>0 else editsize, new= _("(N!) ") if action == "new" else "", minor=_("m ") if action == "edit" and params["minor"] else "") + elif action in ("upload/overwrite", "upload/upload"): #sending files license = None urls = safe_read(recent_changes.safe_request("https://{wiki}.gamepedia.com/api.php?action=query&format=json&prop=imageinfo&list=&meta=&titles={filename}&iiprop=timestamp%7Curl&iilimit=2".format(wiki=settings["wiki"], filename=params["title"])), "query", "pages") undolink = "" @@ -166,48 +166,48 @@ def webhook_formatter(action, STATIC, **params): if additional_info_retrieved: embed["fields"] = [{"name": _("Options"), "value": _("([preview]({link}))").format(link=embed["image"]["url"])}] params["desc"] = _("{desc}\nLicense: {license}").format(desc=params["desc"], license=license if license is not None else "?") - elif action == 6: + elif action == "delete/delete": link = "https://{wiki}.gamepedia.com/{article}".format(wiki=settings["wiki"], article=params["title"].replace(" ", "_")) embed["title"] = _("Deleted page {article}").format(article=params["title"]) - elif action == 7: + elif action == "delete/delete_redir": link = "https://{wiki}.gamepedia.com/{article}".format(wiki=settings["wiki"], article=params["title"].replace(" ", "_")) embed["title"] = _("Deleted redirect {article} by overwriting").format(article=params["title"]) - elif action == 14: + elif action == "move/move": 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: + elif action == "move/move_redir": link = "https://{wiki}.gamepedia.com/{article}".format(wiki=settings["wiki"], article=params["target"].replace(" ", "_")) embed["title"] = _("Moved {article} to {title} over redirect").format(article=params["title"], title=params["target"]) - elif action == 16: + elif action == "protect/move_prot": link = "https://{wiki}.gamepedia.com/{article}".format(wiki=settings["wiki"], article=params["title"].replace(" ", "_")) embed["title"] = _("Moved protection settings from {article} to {title}").format(article=params["title"], title=params["target"]) - elif action == 17: + elif action == "block/block": link = "https://{wiki}.gamepedia.com/{user}".format(wiki=settings["wiki"], user=params["blocked_user"].replace(" ", "_").replace(')', '\)')) user = params["blocked_user"].split(':')[1] time =_( "infinity and beyond") if params["duration"] == "infinite" else params["duration"] embed["title"] = _("Blocked {blocked_user} for {time}").format(blocked_user=user, time=time) - elif action == 19: + elif action == "block/reblock": link = "https://{wiki}.gamepedia.com/{user}".format(wiki=settings["wiki"], user=params["blocked_user"].replace(" ", "_").replace(')', '\)')) user = params["blocked_user"].split(':')[1] embed["title"] = _("Changed block settings for {blocked_user}").format(blocked_user=user) - elif action == 18: + elif action == "block/unblock": link = "https://{wiki}.gamepedia.com/{user}".format(wiki=settings["wiki"], user=params["blocked_user"].replace(" ", "_").replace(')', '\)')) user = params["blocked_user"].split(':')[1] embed["title"] = _("Unblocked {blocked_user}").format(blocked_user=user) - elif action == 25: + elif action == "curseprofile/comment-created": link = "https://{wiki}.gamepedia.com/Special:CommentPermalink/{commentid}".format(wiki=settings["wiki"], commentid=params["commentid"]) #link = "https://{wiki}.gamepedia.com/UserProfile:{target}".format(wiki=settings["wiki"], target=params["target"].replace(" ", "_").replace(')', '\)')) old way of linking embed["title"] = _("Left a comment on {target}'s profile").format(target=params["target"]) - elif action == 29: + elif action == "curseprofile/comment-replied": #link = "https://{wiki}.gamepedia.com/UserProfile:{target}".format(wiki=settings["wiki"], target=params["target"].replace(" ", "_").replace(')', '\)')) link = "https://{wiki}.gamepedia.com/Special:CommentPermalink/{commentid}".format(wiki=settings["wiki"], commentid=params["commentid"]) embed["title"] = _("Replied to a comment on {target}'s profile").format(target=params["target"]) - elif action == 26: + elif action == "curseprofile/comment-edited": #link = "https://{wiki}.gamepedia.com/UserProfile:{target}".format(wiki=settings["wiki"], target=params["target"].replace(" ", "_").replace(')', '\)')) link = "https://{wiki}.gamepedia.com/Special:CommentPermalink/{commentid}".format(wiki=settings["wiki"], commentid=params["commentid"]) embed["title"] = _("Edited a comment on {target}'s profile").format(target=params["target"]) - elif action == 28: + elif action == "curseprofile/profile-edited": link = "https://{wiki}.gamepedia.com/UserProfile:{target}".format(wiki=settings["wiki"], target=params["target"].replace(" ", "_").replace(')', '\)')) if params["field"] == "profile-location": field = _("Location") @@ -235,13 +235,18 @@ def webhook_formatter(action, STATIC, **params): field = _("Unknown") embed["title"] = _("Edited {target}'s profile").format(target=params["target"]) params["desc"] = _("{field} field changed to: {desc}").format(field=field, desc=params["desc"]) - elif action == 27: + elif action == "curseprofile/comment-deleted": link = "https://{wiki}.gamepedia.com/Special:CommentPermalink/{commentid}".format(wiki=settings["wiki"], commentid=params["commentid"]) #link = "https://{wiki}.gamepedia.com/UserProfile:{target}".format(wiki=settings["wiki"], target=params["target"].replace(" ", "_").replace(')', '\)')) embed["title"] = _("Deleted a comment on {target}'s profile").format(target=params["target"]) - elif action == 20: + elif action in ("rights/rights", "rights/autopromote"): link = "https://{wiki}.gamepedia.com/User:".format(wiki=settings["wiki"])+params["title"].split(":")[1] - embed["title"] = _("Changed group membership for {target}").format(target=params["title"].split(":")[1]) + if action == "rights/rights": + embed["title"] = _("Changed group membership for {target}").format(target=params["title"].split(":")[1]) + else: + params["user"] = _("System") + author_url = "" + embed["title"] = _("{target} got autopromoted to a new usergroup").format(target=params["title"].split(":")[1]) if len(params["old_groups"]) < len(params["new_groups"]): embed["thumbnail"]["url"] = "https://i.imgur.com/WnGhF5g.gif" old_groups = [] @@ -256,75 +261,75 @@ def webhook_formatter(action, STATIC, **params): new_groups = [_("none")] reason = ": {desc}".format(desc=params["desc"]) if params["desc"]!=_("No description provided") else "" params["desc"] = _("Groups changed from {old_groups} to {new_groups}{reason}").format(old_groups=", ".join(old_groups), new_groups=', '.join(new_groups), reason=reason) - elif action == 2: + elif action == "protect/protect": link = "https://{wiki}.gamepedia.com/{article}".format(wiki=settings["wiki"], article=params["title"].replace(" ", "_")) embed["title"] = _("Protected {target}").format(target=params["title"]) params["desc"] = params["settings"] + " | " + params["desc"] - elif action == 3: + elif action == "protect/modify": link = "https://{wiki}.gamepedia.com/{article}".format(wiki=settings["wiki"], article=params["title"].replace(" ", "_")) embed["title"] = _("Changed protection level for {article}").format(article=params["title"]) params["desc"] = params["settings"] + " | " + params["desc"] - elif action == 4: + elif action == "protect/unprotect": link = "https://{wiki}.gamepedia.com/{article}".format(wiki=settings["wiki"], article=params["title"].replace(" ", "_")) embed["title"] = _("Removed protection from {article}").format(article=params["title"]) - elif action == 9: + elif action == "delete/revision": link = "https://{wiki}.gamepedia.com/{article}".format(wiki=settings["wiki"], article=params["title"].replace(" ", "_")) embed["title"] = _("Changed visibility of revision(s) on page {article} ").format(article=params["title"]) - elif action == 11: + elif action == "import/upload": link = "https://{wiki}.gamepedia.com/{article}".format(wiki=settings["wiki"], article=params["title"].replace(" ", "_")) embed["title"] = _("Imported {article} with {count} revision(s)").format(article=params["title"], count=params["amount"]) - elif action == 8: + elif action == "delete/restore": link = "https://{wiki}.gamepedia.com/{article}".format(wiki=settings["wiki"], article=params["title"].replace(" ", "_")) embed["title"] = _("Restored {article}").format(article=params["title"]) - elif action == 10: + elif action == "delete/event": link = "https://{wiki}.gamepedia.com/Special:RecentChanges".format(wiki=settings["wiki"]) embed["title"] = _("Changed visibility of log events") - elif action == 12: + elif action == "import/interwiki": link = "https://{wiki}.gamepedia.com/Special:RecentChanges".format(wiki=settings["wiki"]) embed["title"] = _("Imported interwiki") - elif action == 21: + elif action == "abusefilter/modify": link = "https://{wiki}.gamepedia.com/Special:RecentChanges".format(wiki=settings["wiki"]) embed["title"] = _("Edited abuse filter number {number}").format(number=params["filternr"]) - elif action == 13: + elif action == "merge/merge": link = "https://{wiki}.gamepedia.com/{article}".format(wiki=settings["wiki"], article=params["title"].replace(" ", "_")) embed["title"] = _("Merged revision histories of {article} into {dest}").format(article=params["title"], dest=params["destination"]) - elif action == 22: + elif action == "interwiki/iw_add": link = "https://{wiki}.gamepedia.com/Special:Interwiki".format(wiki=settings["wiki"]) embed["title"] = _("Added an entry to the interwiki table") params["desc"] =_("Prefix: {prefix}, website: {website} | {desc}").format(desc=params["desc"], prefix=params["prefix"], website=params["website"]) - elif action == 23: + elif action == "interwiki/iw_edit": link = "https://{wiki}.gamepedia.com/Special:Interwiki".format(wiki=settings["wiki"]) embed["title"] = _("Edited an entry in interwiki table") params["desc"] =_("Prefix: {prefix}, website: {website} | {desc}").format(desc=params["desc"], prefix=params["prefix"], website=params["website"]) - elif action == 24: + elif action == "interwiki/iw_delete": link = "https://{wiki}.gamepedia.com/Special:Interwiki".format(wiki=settings["wiki"]) embed["title"] = _("Deleted an entry in interwiki table") params["desc"] =_("Prefix: {prefix} | {desc}").format(desc=params["desc"], prefix=params["prefix"]) - elif action == 30: + elif action == "contentmodel/change": link = "https://{wiki}.gamepedia.com/{article}".format(wiki=settings["wiki"], article=params["title"].replace(" ", "_")) embed["title"] = _("Changed the content model of the page {article}").format(article=params["title"]) params["desc"] = _("Model changed from {old} to {new}: {reason}").format(old=params["oldmodel"], new=params["newmodel"], reason=params["desc"]) - elif action == 31: + elif action == "sprite/sprite": link = "https://{wiki}.gamepedia.com/{article}".format(wiki=settings["wiki"], article=params["title"].replace(" ", "_")) embed["title"] = _("Edited the sprite for {article}").format(article=params["title"]) - elif action == 32: + elif action == "sprite/sheet": link = "https://{wiki}.gamepedia.com/{article}".format(wiki=settings["wiki"], article=params["title"].replace(" ", "_")) embed["title"] = _("Created the sprite sheet for {article}").format(article=params["title"]) - elif action == 33: + elif action == "sprite/slice": link = "https://{wiki}.gamepedia.com/{article}".format(wiki=settings["wiki"], article=params["title"].replace(" ", "_")) embed["title"] = _("Edited the slice for {article}").format(article=params["title"]) - elif action == 34: + elif action == "managetags/create": link = "https://{wiki}.gamepedia.com/Special:Tags" embed["title"] = _("Created a tag \"{tag}\"").format(tag=params["additional"]["tag"]) recent_changes.update_tags() - elif action == 35: + elif action == "managetags/delete": link = "https://{wiki}.gamepedia.com/Special:Tags" embed["title"] = _("Deleted a tag \"{tag}\"").format(tag=params["additional"]["tag"]) recent_changes.update_tags() - elif action == 36: + elif action == "managetags/activate": link = "https://{wiki}.gamepedia.com/Special:Tags" embed["title"] = _("Activated a tag \"{tag}\"").format(tag=params["additional"]["tag"]) - elif action == 38: + elif action == "managetags/deactivate": link = "https://{wiki}.gamepedia.com/Special:Tags" embed["title"] = _("Deactivated a tag \"{tag}\"").format(tag=params["additional"]["tag"]) else: @@ -378,11 +383,9 @@ def first_pass(change): #I've decided to split the embed formatter and change ha parsedcomment = _("No description provided") if change["type"] == "edit" and "edit" not in settings["ignored"]: STATIC_VARS = {**STATIC_VARS ,**{"color": settings["appearance"]["edit"]["color"], "icon": settings["appearance"]["edit"]["icon"]}} - webhook_formatter(1, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, oldrev=change["old_revid"], pageid=change["pageid"], diff=change["revid"], size=change["newlen"]-change["oldlen"], minor= True if "minor" in change else False) + webhook_formatter("edit", STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, oldrev=change["old_revid"], pageid=change["pageid"], diff=change["revid"], size=change["newlen"]-change["oldlen"], minor= True if "minor" in change else False) elif change["type"] == "log": - logtype = change["logtype"] - logaction = change["logaction"] - combination = "{logtype}/{logaction}".format(logtype=logtype, logaction=logaction) + combination = "{logtype}/{logaction}".format(logtype=change["logtype"], logaction=change["logaction"]) if combination in settings["ignored"]: return logging.debug("combination is {}".format(combination)) @@ -391,82 +394,84 @@ def first_pass(change): #I've decided to split the embed formatter and change ha except KeyError: STATIC_VARS = {**STATIC_VARS ,**{"color": "", "icon": ""}} logging.error("No value in the settings has been given for {}".format(combination)) - if logtype=="protect" and logaction=="protect": - webhook_formatter(2, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, settings=change["logparams"]["description"]) - elif logtype=="protect" and logaction=="modify": - webhook_formatter(3, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, settings=change["logparams"]["description"]) - elif logtype=="protect" and logaction=="unprotect": - webhook_formatter(4, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment) - elif logtype=="upload" and logaction=="overwrite": - webhook_formatter(5, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, overwrite=True) - elif logtype=="upload": - webhook_formatter(5, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, overwrite=False) - elif logtype=="delete" and logaction=="delete": - webhook_formatter(6, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment) - elif logtype=="delete" and logaction=="delete_redir": - webhook_formatter(7, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment) - elif logtype=="delete" and logaction=="restore": - webhook_formatter(8, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment) - elif logtype=="delete" and logaction=="revision": - webhook_formatter(9, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment) - elif logtype=="delete" and logaction=="event": - webhook_formatter(10, STATIC_VARS, user=change["user"], desc=parsedcomment) - elif logtype=="import" and logaction=="upload": - webhook_formatter(11, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, amount=change["logparams"]["count"]) - elif logtype=="import" and logaction=="interwiki": - webhook_formatter(12, STATIC_VARS, user=change["user"], desc=parsedcomment) - elif logtype=="merge" : - webhook_formatter(13, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, destination=change["logparams"]["dest_title"]) - elif logtype=="move" and logaction=="move": - webhook_formatter(14, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, supress=True if "suppressredirect" in change["logparams"] else False, target=change["logparams"]['target_title']) - elif logtype=="move" and logaction=="move_redir": - webhook_formatter(15, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, target=change["logparams"]["target_title"]) - elif logtype=="protect" and logaction=="move_prot": - webhook_formatter(16, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, target=change["logparams"]["oldtitle_title"]) - elif logtype=="block" and logaction=="block": - webhook_formatter(17, STATIC_VARS, user=change["user"], blocked_user=change["title"], desc=parsedcomment, duration=change["logparams"]["duration"]) - elif logtype=="block" and logaction=="unblock": - webhook_formatter(18, STATIC_VARS, user=change["user"], blocked_user=change["title"], desc=parsedcomment) - elif logtype=="block": - webhook_formatter(19, STATIC_VARS, user=change["user"], blocked_user=change["title"], desc=parsedcomment) - elif logtype=="rights": - webhook_formatter(20, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, old_groups=change["logparams"]["oldgroups"], new_groups=change["logparams"]["newgroups"]) - elif logtype=="abusefilter": - webhook_formatter(21, STATIC_VARS, user=change["user"], desc=parsedcomment, filternr=change["logparams"]['1']) - elif logtype=="interwiki" and logaction=="iw_add": - webhook_formatter(22, STATIC_VARS, user=change["user"], desc=parsedcomment, prefix=change["logparams"]['0'], website=change["logparams"]['1']) - elif logtype=="interwiki" and logaction=="iw_edit": - webhook_formatter(23, STATIC_VARS, user=change["user"], desc=parsedcomment, prefix=change["logparams"]['0'], website=change["logparams"]['1']) - elif logtype=="interwiki" and logaction=="iw_delete": - webhook_formatter(24, STATIC_VARS, user=change["user"], desc=parsedcomment, prefix=change["logparams"]['0']) - elif logtype=="curseprofile" and logaction=="comment-created": - webhook_formatter(25, STATIC_VARS, user=change["user"], target=change["title"].split(':')[1], commentid=change["logparams"]["0"]) - elif logtype=="curseprofile" and logaction=="comment-edited": - webhook_formatter(26, STATIC_VARS, user=change["user"], target=change["title"].split(':')[1], commentid=change["logparams"]["0"]) - elif logtype=="curseprofile" and logaction=="comment-deleted": - webhook_formatter(27, STATIC_VARS, user=change["user"], target=change["title"].split(':')[1], commentid=change["logparams"]["0"]) - elif logtype=="curseprofile" and logaction=="profile-edited": - webhook_formatter(28, STATIC_VARS, user=change["user"], target=change["title"].split(':')[1], field=change["logparams"]['0'], desc=change["parsedcomment"]) - elif logtype=="curseprofile" and logaction=="comment-replied": - webhook_formatter(29, STATIC_VARS, user=change["user"], target=change["title"].split(':')[1], commentid=change["logparams"]["0"]) - elif logtype=="contentmodel" and logaction=="change": - webhook_formatter(30, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, oldmodel=change["logparams" ]["oldmodel"], newmodel=change["logparams" ]["newmodel"]) - elif logtype=="sprite" and logaction=="sprite": - webhook_formatter(31, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment) - elif logtype=="sprite" and logaction=="sheet": - webhook_formatter(32, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment) - elif logtype=="sprite" and logaction=="slice": - webhook_formatter(33, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment) - elif logtype=="managetags" and logaction=="create": - webhook_formatter(34, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, additional=change["logparams"]) - elif logtype=="managetags" and logaction=="delete": - webhook_formatter(35, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, additional=change["logparams"]) - elif logtype=="managetags" and logaction=="activate": - webhook_formatter(36, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, additional=change["logparams"]) - elif logtype=="managetags" and logaction=="deactivate": - webhook_formatter(38, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, additional=change["logparams"]) - elif logtype=="tag" and logaction=="update": - webhook_formatter(39, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment) + if combination == "protect/protect" + webhook_formatter(combination, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, settings=change["logparams"]["description"]) + elif combination=="protect/modify": + webhook_formatter(combination, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, settings=change["logparams"]["description"]) + elif combination=="protect/unprotect": + webhook_formatter(combination, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment) + elif combination=="upload/overwrite": + webhook_formatter(combination, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, overwrite=True) + elif combination=="upload/upload": + webhook_formatter(combination, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, overwrite=False) + elif combination=="delete/delete": + webhook_formatter(combination, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment) + elif combination=="delete/delete_redir": + webhook_formatter(combination, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment) + elif combination=="delete/restore": + webhook_formatter(combination, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment) + elif combination=="delete/revision": + webhook_formatter(combination, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment) + elif combination=="delete/event": + webhook_formatter(combination, STATIC_VARS, user=change["user"], desc=parsedcomment) + elif combination=="import/upload": + webhook_formatter(combination, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, amount=change["logparams"]["count"]) + elif combination=="import/interwiki": + webhook_formatter(combination, STATIC_VARS, user=change["user"], desc=parsedcomment) + elif combination=="merge/merge" : + webhook_formatter(combination, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, destination=change["logparams"]["dest_title"]) + elif combination=="move/move": + webhook_formatter(combination, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, supress=True if "suppressredirect" in change["logparams"] else False, target=change["logparams"]['target_title']) + elif combination=="move/move_redir": + webhook_formatter(combination, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, target=change["logparams"]["target_title"]) + elif combination=="protect/move_prot": + webhook_formatter(combination, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, target=change["logparams"]["oldtitle_title"]) + elif combination=="block/block": + webhook_formatter(combination, STATIC_VARS, user=change["user"], blocked_user=change["title"], desc=parsedcomment, duration=change["logparams"]["duration"]) + elif combination=="block/unblock": + webhook_formatter(combination, STATIC_VARS, user=change["user"], blocked_user=change["title"], desc=parsedcomment) + elif combination=="block/reblock": + webhook_formatter(combination, STATIC_VARS, user=change["user"], blocked_user=change["title"], desc=parsedcomment) + elif combination=="rights/rights": + webhook_formatter(combination, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, old_groups=change["logparams"]["oldgroups"], new_groups=change["logparams"]["newgroups"]) + elif combination=="rights/autopromote": + webhook_formatter(combination, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, old_groups=change["logparams"]["oldgroups"], new_groups=change["logparams"]["newgroups"]) + elif combination=="abusefilter/modify": + webhook_formatter(combination, STATIC_VARS, user=change["user"], desc=parsedcomment, filternr=change["logparams"]['1']) + elif combination=="interwiki/iw_add": + webhook_formatter(combination, STATIC_VARS, user=change["user"], desc=parsedcomment, prefix=change["logparams"]['0'], website=change["logparams"]['1']) + elif combination=="interwiki/iw_edit": + webhook_formatter(combination, STATIC_VARS, user=change["user"], desc=parsedcomment, prefix=change["logparams"]['0'], website=change["logparams"]['1']) + elif combination=="interwiki/iw_delete": + webhook_formatter(combination, STATIC_VARS, user=change["user"], desc=parsedcomment, prefix=change["logparams"]['0']) + elif combination=="curseprofile/comment-created": + webhook_formatter(combination, STATIC_VARS, user=change["user"], target=change["title"].split(':')[1], commentid=change["logparams"]["0"]) + elif combination=="curseprofile/comment-edited": + webhook_formatter(combination, STATIC_VARS, user=change["user"], target=change["title"].split(':')[1], commentid=change["logparams"]["0"]) + elif combination=="curseprofile/comment-deleted": + webhook_formatter(combination, STATIC_VARS, user=change["user"], target=change["title"].split(':')[1], commentid=change["logparams"]["0"]) + elif combination=="curseprofile/profile-edited": + webhook_formatter(combination, STATIC_VARS, user=change["user"], target=change["title"].split(':')[1], field=change["logparams"]['0'], desc=change["parsedcomment"]) + elif combination=="curseprofile/comment-replied": + webhook_formatter(combination, STATIC_VARS, user=change["user"], target=change["title"].split(':')[1], commentid=change["logparams"]["0"]) + elif combination=="contentmodel/change": + webhook_formatter(combination, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, oldmodel=change["logparams" ]["oldmodel"], newmodel=change["logparams" ]["newmodel"]) + elif combination=="sprite/sprite": + webhook_formatter(combination, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment) + elif combination=="sprite/sheet": + webhook_formatter(combination, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment) + elif combination=="sprite/slice": + webhook_formatter(combination, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment) + elif combination=="managetags/create": + webhook_formatter(combination, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, additional=change["logparams"]) + elif combination=="managetags/delete": + webhook_formatter(combination, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, additional=change["logparams"]) + elif combination=="managetags/activate": + webhook_formatter(combination, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, additional=change["logparams"]) + elif combination=="managetags/deactivate": + webhook_formatter(combination, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, additional=change["logparams"]) + elif combination=="tag/update": + webhook_formatter(combination, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment) else: logging.warning("No entry matches given change!") print (change) @@ -478,7 +483,7 @@ def first_pass(change): #I've decided to split the embed formatter and change ha return elif change["type"] == "new" and "new" not in settings["ignored"]: #new page STATIC_VARS = {**STATIC_VARS ,**{"color": settings["appearance"]["new"]["color"], "icon": settings["appearance"]["new"]["icon"]}} - webhook_formatter(37, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, oldrev=change["old_revid"], pageid=change["pageid"], diff=change["revid"], size=change["newlen"]) + webhook_formatter("new", STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, oldrev=change["old_revid"], pageid=change["pageid"], diff=change["revid"], size=change["newlen"]) def day_overview_request(): logging.info("Fetching daily overview... This may take up to 30 seconds!")