Markus-Rost 3 年 前
コミット
ce2bd7ffc7
2 ファイル変更13 行追加1 行削除
  1. 12 0
      util/default.json
  2. 1 1
      util/newMessage.js

+ 12 - 0
util/default.json

@@ -100,6 +100,12 @@
 		]
 	},
 	"wikiProjects": [
+		{
+			"name": "fandom.com",
+			"regex": "((?:[a-z\\d-]{1,50}\\.)fandom\\.com(?:/[a-z-]{2,12})?)",
+			"articlePath": "/wiki/",
+			"scriptPath": "/"
+		},
 		{
 			"name": "wikipedia.org",
 			"regex": "((?:[a-z\\d-]{1,50}\\.)?(?:m\\.)?wikipedia\\.org)",
@@ -172,6 +178,12 @@
 			"articlePath": "/wiki/",
 			"scriptPath": "/w/"
 		},
+		{
+			"name": "wiki.gg",
+			"regex": "((?:[a-z\\d-]{1,50}\\.)wiki\\.gg(?:/[a-z-]{2,12})?)",
+			"articlePath": "/wiki/",
+			"scriptPath": "/"
+		},
 		{
 			"name": "miraheze.org",
 			"regex": "((?:[a-z\\d-]{1,50}\\.)miraheze\\.org)",

+ 1 - 1
util/newMessage.js

@@ -103,7 +103,7 @@ export default function newMessage(msg, lang, wiki = defaultSettings.wiki, prefi
 			else invokeWiki = 'https://' + invoke.substring(2) + '.wikia.org/';
 			return cmdmap.LINK(lang, msg, args.join(' '), new Wiki(invokeWiki), invoke + ' ');
 		}
-		if ( invoke.startsWith( '!!' ) && /^!!(?:[a-z\d-]{1,50}\.)?[a-z\d-]{1,50}\.[a-z\d-]{1,10}(?:\/|$)/.test(domainToASCII(invoke)) ) {
+		if ( invoke.startsWith( '!!' ) && /^!!(?:[a-z\d-]{1,50}\.)?[a-z\d-]{1,50}\.[a-z\d-]{1,10}$/.test(domainToASCII(invoke.split('/')[0])) ) {
 			let project = wikiProjects.find( project => invoke.split('/')[0].endsWith( project.name ) );
 			if ( project ) {
 				let regex = invoke.match( new RegExp( project.regex ) );