Browse Source

Add wiki-aventurica.de and pnpwiki.de

Markus-Rost 4 years ago
parent
commit
921020345f
2 changed files with 13 additions and 1 deletions
  1. 1 1
      cmds/wiki/general.js
  2. 12 0
      util/default.json

+ 1 - 1
cmds/wiki/general.js

@@ -120,7 +120,7 @@ function gamepedia_check_wiki(lang, msg, title, wiki, cmd, reaction, spoiler = '
 			else minecraft.SYNTAX(lang, msg, wiki, invoke.substring(1), args, title, cmd, reaction, spoiler);
 			return;
 		}
-		if ( body.query.pages ) {
+		if ( body.query.pages && body.query.pages?.['-1']?.title !== '%1F' ) {
 			var querypages = Object.values(body.query.pages);
 			var querypage = querypages[0];
 			if ( body.query.redirects && body.query.redirects[0].from.split(':')[0] === body.query.namespaces['-1']['*'] && body.query.specialpagealiases.filter( sp => ['Mypage','Mytalk','MyLanguage'].includes( sp.realname ) ).map( sp => sp.aliases[0] ).includes( body.query.redirects[0].from.split(':').slice(1).join(':').split('/')[0].replace( / /g, '_' ) ) ) {

+ 12 - 0
util/default.json

@@ -236,6 +236,18 @@
 			"regex": "(revi\\.wiki)",
 			"articlePath": "/wiki/",
 			"scriptPath": "/w/"
+		},
+		{
+			"name": "wiki-aventurica.de",
+			"regex": "((?:[a-z\\d-]{1,50}\\.)?wiki-aventurica\\.de)",
+			"articlePath": "/wiki/",
+			"scriptPath": "/de/"
+		},
+		{
+			"name": "pnpwiki.de",
+			"regex": "((?:www\\.)?pnpwiki\\.de)",
+			"articlePath": "/wiki/",
+			"scriptPath": "/w/"
 		}
 	]
 }