mirror of
https://gitlab.com/chicken-riders/RcGcDw.git
synced 2025-02-23 00:24:09 +00:00
Fix issue when the content is revdeleted before we fetch diff
(just don't provide diffs on MediaWiki errors)
This commit is contained in:
parent
468c381883
commit
b6065a8188
|
@ -81,7 +81,7 @@ def embed_edit(ctx: Context, change: dict) -> DiscordMessage:
|
||||||
changed_content = ctx.client.make_api_request(
|
changed_content = ctx.client.make_api_request(
|
||||||
"?action=compare&format=json&fromrev={oldrev}&torev={diff}&topst=1&prop=diff".format(
|
"?action=compare&format=json&fromrev={oldrev}&torev={diff}&topst=1&prop=diff".format(
|
||||||
diff=change["revid"], oldrev=change["old_revid"]), "compare", "*")
|
diff=change["revid"], oldrev=change["old_revid"]), "compare", "*")
|
||||||
except ServerError:
|
except (ServerError, MediaWikiError):
|
||||||
changed_content = None
|
changed_content = None
|
||||||
if changed_content:
|
if changed_content:
|
||||||
parse_mediawiki_changes(ctx, changed_content, embed)
|
parse_mediawiki_changes(ctx, changed_content, embed)
|
||||||
|
|
Loading…
Reference in a new issue