Browse Source

verify user search

Markus-Rost 5 years ago
parent
commit
2470ea5f72
14 changed files with 112 additions and 40 deletions
  1. 2 2
      bot.js
  2. 8 7
      cmds/settings.js
  3. 26 7
      cmds/verify.js
  4. 26 11
      functions/special_page.js
  5. 1 1
      i18n/de.json
  6. 1 1
      i18n/en.json
  7. 1 1
      i18n/fr.json
  8. 1 1
      i18n/nl.json
  9. 2 2
      i18n/pl.json
  10. 1 1
      i18n/pt.json
  11. 1 1
      i18n/ru.json
  12. 2 2
      i18n/tr.json
  13. 2 2
      i18n/zh.json
  14. 38 1
      util/i18n.js

+ 2 - 2
bot.js

@@ -354,14 +354,14 @@ client.on( 'guildDelete', guild => {
 		}
 		}
 		if ( guild.id in patreons ) client.shard.broadcastEval( `delete global.patreons['${guild.id}']` );
 		if ( guild.id in patreons ) client.shard.broadcastEval( `delete global.patreons['${guild.id}']` );
 		if ( guild.id in voice ) delete voice[guild.id];
 		if ( guild.id in voice ) delete voice[guild.id];
-		console.log( '- Settings successfully removed.' );
+		if ( this.changes ) console.log( '- Settings successfully removed.' );
 	} );
 	} );
 	db.run( 'DELETE FROM verification WHERE guild = ?', [guild.id], function (dberror) {
 	db.run( 'DELETE FROM verification WHERE guild = ?', [guild.id], function (dberror) {
 		if ( dberror ) {
 		if ( dberror ) {
 			console.log( '- Error while removing the verifications: ' + dberror );
 			console.log( '- Error while removing the verifications: ' + dberror );
 			return dberror;
 			return dberror;
 		}
 		}
-		console.log( '- Verifications successfully removed.' );
+		if ( this.changes ) console.log( '- Verifications successfully removed.' );
 	} );
 	} );
 } );
 } );
 
 

+ 8 - 7
cmds/settings.js

@@ -29,15 +29,16 @@ function cmd_settings(lang, msg, args, line, wiki) {
 		var guild = rows.find( row => !row.channel );
 		var guild = rows.find( row => !row.channel );
 		if ( !guild ) guild = Object.assign({prefix: process.env.prefix}, defaultSettings);
 		if ( !guild ) guild = Object.assign({prefix: process.env.prefix}, defaultSettings);
 		var prefix = guild.prefix;
 		var prefix = guild.prefix;
+		var inlinepage = ( lang.localNames.page || 'page' );
 		var text = lang.get('settings.missing', '`' + prefix + 'settings lang`', '`' + prefix + 'settings wiki`');
 		var text = lang.get('settings.missing', '`' + prefix + 'settings lang`', '`' + prefix + 'settings wiki`');
 		if ( rows.length ) {
 		if ( rows.length ) {
 			text = lang.get('settings.current') + '\n' + lang.get('settings.currentlang') + ' `' + allLangs.names[guild.lang][1] + '` - `' + prefix + 'settings lang`';
 			text = lang.get('settings.current') + '\n' + lang.get('settings.currentlang') + ' `' + allLangs.names[guild.lang][1] + '` - `' + prefix + 'settings lang`';
 			if ( msg.guild.id in patreons ) text += '\n' + lang.get('settings.currentprefix') + ' `' + prefix + '` - `' + prefix + 'settings prefix`';
 			if ( msg.guild.id in patreons ) text += '\n' + lang.get('settings.currentprefix') + ' `' + prefix + '` - `' + prefix + 'settings prefix`';
-			text += '\n' + lang.get('settings.currentinline') + ' ' + ( guild.inline ? '~~' : '' ) + '`[[' + lang.get('search.page') + ']]`' + ( guild.inline ? '~~' : '' ) + ' - `' + prefix + 'settings inline`';
+			text += '\n' + lang.get('settings.currentinline') + ' ' + ( guild.inline ? '~~' : '' ) + '`[[' + inlinepage + ']]`' + ( guild.inline ? '~~' : '' ) + ' - `' + prefix + 'settings inline`';
 			text += '\n' + lang.get('settings.currentwiki') + ' ' + guild.wiki + ' - `' + prefix + 'settings wiki`';
 			text += '\n' + lang.get('settings.currentwiki') + ' ' + guild.wiki + ' - `' + prefix + 'settings wiki`';
 			text += '\n' + lang.get('settings.currentchannel') + ' `' + prefix + 'settings channel`\n';
 			text += '\n' + lang.get('settings.currentchannel') + ' `' + prefix + 'settings channel`\n';
 			if ( rows.length === 1 ) text += lang.get('settings.nochannels');
 			if ( rows.length === 1 ) text += lang.get('settings.nochannels');
-			else text += rows.filter( row => row !== guild ).map( row => '<#' + row.channel + '>: ' + ( msg.guild.id in patreons ? '`' + allLangs.names[row.lang][1] + '` - ' : '' ) + '<' + row.wiki + '>' + ( msg.guild.id in patreons ? ' - ' + ( row.inline ? '~~' : '' ) + '`[[' + lang.get('search.page') + ']]`' + ( row.inline ? '~~' : '' ) : '' ) ).join('\n');
+			else text += rows.filter( row => row !== guild ).map( row => '<#' + row.channel + '>: ' + ( msg.guild.id in patreons ? '`' + allLangs.names[row.lang][1] + '` - ' : '' ) + '<' + row.wiki + '>' + ( msg.guild.id in patreons ? ' - ' + ( row.inline ? '~~' : '' ) + '`[[' + inlinepage + ']]`' + ( row.inline ? '~~' : '' ) : '' ) ).join('\n');
 		}
 		}
 		
 		
 		if ( !args.length ) {
 		if ( !args.length ) {
@@ -55,7 +56,7 @@ function cmd_settings(lang, msg, args, line, wiki) {
 			text = lang.get('settings.' + prelang + 'current');
 			text = lang.get('settings.' + prelang + 'current');
 			if ( msg.guild.id in patreons ) {
 			if ( msg.guild.id in patreons ) {
 				text += '\n' + lang.get('settings.currentlang') + ' `' + allLangs.names[channel.lang][1] + '` - `' + prefix + 'settings channel lang`';
 				text += '\n' + lang.get('settings.currentlang') + ' `' + allLangs.names[channel.lang][1] + '` - `' + prefix + 'settings channel lang`';
-				text += '\n' + lang.get('settings.currentinline') + ' ' + ( channel.inline ? '~~' : '' ) + '`[[' + lang.get('search.page') + ']]`' + ( channel.inline ? '~~' : '' ) + ' - `' + prefix + 'settings channel inline`';
+				text += '\n' + lang.get('settings.currentinline') + ' ' + ( channel.inline ? '~~' : '' ) + '`[[' + inlinepage + ']]`' + ( channel.inline ? '~~' : '' ) + ' - `' + prefix + 'settings channel inline`';
 			}
 			}
 			text += '\n' + lang.get('settings.currentwiki') + ' ' + channel.wiki + ' - `' + prefix + 'settings channel wiki`';
 			text += '\n' + lang.get('settings.currentwiki') + ' ' + channel.wiki + ' - `' + prefix + 'settings channel wiki`';
 			
 			
@@ -264,7 +265,7 @@ function cmd_settings(lang, msg, args, line, wiki) {
 			var prefixhelp = '\n' + lang.get('settings.prefixhelp', prefix + 'settings prefix');
 			var prefixhelp = '\n' + lang.get('settings.prefixhelp', prefix + 'settings prefix');
 			args[1] = args[1].replace( /(?<!\\)_$/, ' ' ).replace( /\\([_\W])/g, '$1' );
 			args[1] = args[1].replace( /(?<!\\)_$/, ' ' ).replace( /\\([_\W])/g, '$1' );
 			if ( !args[1].trim() ) {
 			if ( !args[1].trim() ) {
-				return msg.replyMsg( lang.get('settings.prefix') + ' `' + prefix.replace( / $/, '_' ) + '`' + prefixhelp, {}, true );
+				return msg.replyMsg( lang.get('settings.prefix') + ' `' + prefix + '`' + prefixhelp, {}, true );
 			}
 			}
 			if ( args[1].includes( '`' ) || args[1].length > 100 ) {
 			if ( args[1].includes( '`' ) || args[1].length > 100 ) {
 				return msg.replyMsg( lang.get('settings.prefixinvalid') + prefixhelp, {}, true );
 				return msg.replyMsg( lang.get('settings.prefixinvalid') + prefixhelp, {}, true );
@@ -284,7 +285,7 @@ function cmd_settings(lang, msg, args, line, wiki) {
 				console.log( '- Settings successfully updated.' );
 				console.log( '- Settings successfully updated.' );
 				guild.prefix = args[1];
 				guild.prefix = args[1];
 				msg.client.shard.broadcastEval( `global.patreons['${msg.guild.id}'] = '${args[1]}'` );
 				msg.client.shard.broadcastEval( `global.patreons['${msg.guild.id}'] = '${args[1]}'` );
-				msg.replyMsg( lang.get('settings.prefixchanged') + ' `' + args[1].replace( / $/, '_' ) + '`\n' + lang.get('settings.prefixhelp', args[1] + 'settings prefix'), {}, true );
+				msg.replyMsg( lang.get('settings.prefixchanged') + ' `' + args[1] + '`\n' + lang.get('settings.prefixhelp', args[1] + 'settings prefix'), {}, true );
 			} );
 			} );
 		}
 		}
 		
 		
@@ -292,7 +293,7 @@ function cmd_settings(lang, msg, args, line, wiki) {
 			if ( channel && !( msg.guild.id in patreons ) ) return msg.replyMsg( lang.get('patreon') + ' <' + process.env.patreon + '>', {}, true );
 			if ( channel && !( msg.guild.id in patreons ) ) return msg.replyMsg( lang.get('patreon') + ' <' + process.env.patreon + '>', {}, true );
 			prelang += 'inline';
 			prelang += 'inline';
 			var toggle = 'inline ' + ( ( channel || guild ).inline ? 'disabled' : 'enabled' );
 			var toggle = 'inline ' + ( ( channel || guild ).inline ? 'disabled' : 'enabled' );
-			var inlinehelp = '\n' + lang.get('settings.' + toggle + '.help', prefix + 'settings ' + prelang + ' toggle', lang.get('search.page'));
+			var inlinehelp = '\n' + lang.get('settings.' + toggle + '.help', prefix + 'settings ' + prelang + ' toggle', inlinepage);
 			if ( args[1] !== 'toggle' ) {
 			if ( args[1] !== 'toggle' ) {
 				return msg.replyMsg( lang.get('settings.' + toggle + '.' + prelang) + inlinehelp, {}, true );
 				return msg.replyMsg( lang.get('settings.' + toggle + '.' + prelang) + inlinehelp, {}, true );
 			}
 			}
@@ -325,7 +326,7 @@ function cmd_settings(lang, msg, args, line, wiki) {
 					guild.inline = value;
 					guild.inline = value;
 				}
 				}
 				toggle = 'inline ' + ( ( channel || guild ).inline ? 'disabled' : 'enabled' );
 				toggle = 'inline ' + ( ( channel || guild ).inline ? 'disabled' : 'enabled' );
-				msg.replyMsg( lang.get('settings.' + toggle + '.' + prelang + 'changed') + '\n' + lang.get('settings.' + toggle + '.help', prefix + 'settings ' + prelang + ' toggle', lang.get('search.page')), {}, true );
+				msg.replyMsg( lang.get('settings.' + toggle + '.' + prelang + 'changed') + '\n' + lang.get('settings.' + toggle + '.help', prefix + 'settings ' + prelang + ' toggle', inlinepage), {}, true );
 				var channels = rows.filter( row => row.channel && row.lang === guild.lang && row.wiki === guild.wiki && row.prefix === guild.prefix && row.inline === guild.inline ).map( row => row.channel );
 				var channels = rows.filter( row => row.channel && row.lang === guild.lang && row.wiki === guild.wiki && row.prefix === guild.prefix && row.inline === guild.inline ).map( row => row.channel );
 				if ( channels.length ) db.run( 'DELETE FROM discord WHERE channel IN (' + channels.map( row => '?' ).join(', ') + ')', channels, function (delerror) {
 				if ( channels.length ) db.run( 'DELETE FROM discord WHERE channel IN (' + channels.map( row => '?' ).join(', ') + ')', channels, function (delerror) {
 					if ( delerror ) {
 					if ( delerror ) {

+ 26 - 7
cmds/verify.js

@@ -11,8 +11,9 @@ var db = require('../util/database.js');
  * @param {String[]} args - The command arguments.
  * @param {String[]} args - The command arguments.
  * @param {String} line - The command as plain text.
  * @param {String} line - The command as plain text.
  * @param {String} wiki - The wiki for the message.
  * @param {String} wiki - The wiki for the message.
+ * @param {String} [old_username] - The username before the search.
  */
  */
-function cmd_verify(lang, msg, args, line, wiki) {
+function cmd_verify(lang, msg, args, line, wiki, old_username = '') {
 	if ( msg.channel.type !== 'text' ) return this.LINK(lang, msg, line, wiki);
 	if ( msg.channel.type !== 'text' ) return this.LINK(lang, msg, line, wiki);
 	if ( !msg.guild.me.permissions.has('MANAGE_ROLES') ) {
 	if ( !msg.guild.me.permissions.has('MANAGE_ROLES') ) {
 		if ( msg.isAdmin() || msg.isOwner() ) {
 		if ( msg.isAdmin() || msg.isOwner() ) {
@@ -28,10 +29,11 @@ function cmd_verify(lang, msg, args, line, wiki) {
 	}
 	}
 	if ( wiki.endsWith( '.gamepedia.com/' ) ) username = username.replace( /^userprofile\s*:/i, '' );
 	if ( wiki.endsWith( '.gamepedia.com/' ) ) username = username.replace( /^userprofile\s*:/i, '' );
 	
 	
+	var embed = new MessageEmbed().setFooter( lang.get('verify.footer') + ' • ' + new Date().toLocaleString(lang.get('dateformat'), timeoptions) ).setTimestamp();
 	db.all( 'SELECT role, editcount, usergroup, accountage, rename FROM verification WHERE guild = ? AND channel LIKE ? ORDER BY configid ASC', [msg.guild.id, '%|' + msg.channel.id + '|%'], (dberror, rows) => {
 	db.all( 'SELECT role, editcount, usergroup, accountage, rename FROM verification WHERE guild = ? AND channel LIKE ? ORDER BY configid ASC', [msg.guild.id, '%|' + msg.channel.id + '|%'], (dberror, rows) => {
 		if ( dberror || !rows ) {
 		if ( dberror || !rows ) {
 			console.log( '- Error while getting the verifications: ' + dberror );
 			console.log( '- Error while getting the verifications: ' + dberror );
-			embed.setTitle( username.escapeFormatting() ).setColor('#000000').setDescription( lang.get('verify.error') );
+			embed.setColor('#000000').setDescription( lang.get('verify.error') );
 			msg.replyMsg( lang.get('verify.error_reply'), {embed}, false, false ).then( message => message.reactEmoji('error') );
 			msg.replyMsg( lang.get('verify.error_reply'), {embed}, false, false ).then( message => message.reactEmoji('error') );
 			return dberror;
 			return dberror;
 		}
 		}
@@ -39,10 +41,9 @@ function cmd_verify(lang, msg, args, line, wiki) {
 		
 		
 		if ( !username.trim() ) {
 		if ( !username.trim() ) {
 			args[0] = line.split(' ')[0];
 			args[0] = line.split(' ')[0];
-			if ( args[0] === 'verification' ) args[0] = 'verify';
+			if ( args[0] === 'verification' ) args[0] = ( lang.localNames.verify || 'verify' );
 			return this.help(lang, msg, args, line);
 			return this.help(lang, msg, args, line);
 		}
 		}
-		var embed = new MessageEmbed().setFooter( lang.get('verify.footer') + ' • ' + new Date().toLocaleString(lang.get('dateformat'), timeoptions) ).setTimestamp();
 		msg.reactEmoji('⏳').then( reaction => got.get( wiki + 'api.php?action=query&meta=siteinfo&siprop=general&list=users&usprop=blockinfo|groups|groupmemberships|editcount|registration&ususers=' + encodeURIComponent( username ) + '&format=json', {
 		msg.reactEmoji('⏳').then( reaction => got.get( wiki + 'api.php?action=query&meta=siteinfo&siprop=general&list=users&usprop=blockinfo|groups|groupmemberships|editcount|registration&ususers=' + encodeURIComponent( username ) + '&format=json', {
 			responseType: 'json'
 			responseType: 'json'
 		} ).then( response => {
 		} ).then( response => {
@@ -55,7 +56,7 @@ function cmd_verify(lang, msg, args, line, wiki) {
 				}
 				}
 				else {
 				else {
 					console.log( '- ' + response.statusCode + ': Error while getting the user: ' + ( body && body.error && body.error.info ) );
 					console.log( '- ' + response.statusCode + ': Error while getting the user: ' + ( body && body.error && body.error.info ) );
-					embed.setTitle( username.escapeFormatting() ).setColor('#000000').setDescription( lang.get('verify.error') );
+					embed.setColor('#000000').setDescription( lang.get('verify.error') );
 					msg.replyMsg( lang.get('verify.error_reply'), {embed}, false, false ).then( message => message.reactEmoji('error') );
 					msg.replyMsg( lang.get('verify.error_reply'), {embed}, false, false ).then( message => message.reactEmoji('error') );
 				}
 				}
 				
 				
@@ -66,8 +67,26 @@ function cmd_verify(lang, msg, args, line, wiki) {
 			embed.setAuthor( body.query.general.sitename );
 			embed.setAuthor( body.query.general.sitename );
 			if ( body.query.users.length !== 1 || queryuser.missing !== undefined || queryuser.invalid !== undefined ) {
 			if ( body.query.users.length !== 1 || queryuser.missing !== undefined || queryuser.invalid !== undefined ) {
 				username = ( body.query.users.length === 1 ? queryuser.name : username );
 				username = ( body.query.users.length === 1 ? queryuser.name : username );
-				embed.setTitle( username.escapeFormatting() ).setColor('#0000FF').setDescription( lang.get('verify.user_missing', username.escapeFormatting()) );
-				msg.replyMsg( lang.get('verify.user_missing_reply', username.escapeFormatting()), {embed}, false, false );
+				embed.setTitle( ( old_username || username ).escapeFormatting() ).setColor('#0000FF').setDescription( lang.get('verify.user_missing', ( old_username || username ).escapeFormatting()) );
+				if ( ( wiki.isFandom() || wiki.endsWith( '.gamepedia.com/' ) ) && !old_username ) return got.get( 'https://community.fandom.com/api/v1/User/UsersByName?limit=1&query=' + encodeURIComponent( username ) + '&format=json', {
+					responseType: 'json'
+				} ).then( wsresponse => {
+					var wsbody = wsresponse.body;
+					if ( wsresponse.statusCode !== 200 || wsbody?.exception || wsbody?.users?.[0]?.name?.length !== username.length ) {
+						if ( !wsbody?.users ) console.log( '- ' + wsresponse.statusCode + ': Error while searching the user: ' + wsbody?.exception?.details );
+						msg.replyMsg( lang.get('verify.user_missing_reply', username.escapeFormatting()), {embed}, false, false );
+						
+						if ( reaction ) reaction.removeEmoji();
+						return;
+					}
+					this.verify(lang, msg, wsbody.users[0].name.split(' '), line, wiki, username);
+				}, error => {
+					console.log( '- Error while searching the user: ' + error );
+					msg.replyMsg( lang.get('verify.user_missing_reply', username.escapeFormatting()), {embed}, false, false );
+					
+					if ( reaction ) reaction.removeEmoji();
+				} );
+				msg.replyMsg( lang.get('verify.user_missing_reply', ( old_username || username ).escapeFormatting()), {embed}, false, false );
 				
 				
 				if ( reaction ) reaction.removeEmoji();
 				if ( reaction ) reaction.removeEmoji();
 				return;
 				return;

+ 26 - 11
functions/special_page.js

@@ -48,12 +48,12 @@ const queryfunctions = {
 	} ).join('\n')
 	} ).join('\n')
 }
 }
 
 
-var querypages = {
+const querypages = {
 	ancientpages: ['&list=querypage&qplimit=10&qppage=Ancientpages', queryfunctions.timestamp],
 	ancientpages: ['&list=querypage&qplimit=10&qppage=Ancientpages', queryfunctions.timestamp],
 	brokenredirects: ['&list=querypage&qplimit=10&qppage=BrokenRedirects', queryfunctions.redirect],
 	brokenredirects: ['&list=querypage&qplimit=10&qppage=BrokenRedirects', queryfunctions.redirect],
 	deadendpages: ['&list=querypage&qplimit=10&qppage=Deadendpages', queryfunctions.title],
 	deadendpages: ['&list=querypage&qplimit=10&qppage=Deadendpages', queryfunctions.title],
-	disambiguations: ['&list=querypage&qplimit=10&qppage=Disambiguations', queryfunctions.title],
 	doubleredirects: ['&list=querypage&qplimit=10&qppage=DoubleRedirects', queryfunctions.doubleredirect],
 	doubleredirects: ['&list=querypage&qplimit=10&qppage=DoubleRedirects', queryfunctions.doubleredirect],
+	fewestrevisions: ['&list=querypage&qplimit=10&qppage=Fewestrevisions', queryfunctions.times],
 	listduplicatedfiles: ['&list=querypage&qplimit=10&qppage=ListDuplicatedFiles', queryfunctions.times],
 	listduplicatedfiles: ['&list=querypage&qplimit=10&qppage=ListDuplicatedFiles', queryfunctions.times],
 	listredirects: ['&list=querypage&qplimit=10&qppage=Listredirects', queryfunctions.redirect],
 	listredirects: ['&list=querypage&qplimit=10&qppage=Listredirects', queryfunctions.redirect],
 	lonelypages: ['&list=querypage&qplimit=10&qppage=Lonelypages', queryfunctions.title],
 	lonelypages: ['&list=querypage&qplimit=10&qppage=Lonelypages', queryfunctions.title],
@@ -62,11 +62,10 @@ var querypages = {
 	mostcategories: ['&list=querypage&qplimit=10&qppage=Mostcategories', queryfunctions.times],
 	mostcategories: ['&list=querypage&qplimit=10&qppage=Mostcategories', queryfunctions.times],
 	mostimages: ['&list=querypage&qplimit=10&qppage=Mostimages', queryfunctions.times],
 	mostimages: ['&list=querypage&qplimit=10&qppage=Mostimages', queryfunctions.times],
 	mostinterwikis: ['&list=querypage&qplimit=10&qppage=Mostinterwikis', queryfunctions.times],
 	mostinterwikis: ['&list=querypage&qplimit=10&qppage=Mostinterwikis', queryfunctions.times],
+	mostlinked: ['&list=querypage&qplimit=10&qppage=Mostlinked', queryfunctions.times],
 	mostlinkedcategories: ['&list=querypage&qplimit=10&qppage=Mostlinkedcategories', queryfunctions.times],
 	mostlinkedcategories: ['&list=querypage&qplimit=10&qppage=Mostlinkedcategories', queryfunctions.times],
 	mostlinkedtemplates: ['&list=querypage&qplimit=10&qppage=Mostlinkedtemplates', queryfunctions.times],
 	mostlinkedtemplates: ['&list=querypage&qplimit=10&qppage=Mostlinkedtemplates', queryfunctions.times],
-	mostlinked: ['&list=querypage&qplimit=10&qppage=Mostlinked', queryfunctions.times],
 	mostrevisions: ['&list=querypage&qplimit=10&qppage=Mostrevisions', queryfunctions.times],
 	mostrevisions: ['&list=querypage&qplimit=10&qppage=Mostrevisions', queryfunctions.times],
-	fewestrevisions: ['&list=querypage&qplimit=10&qppage=Fewestrevisions', queryfunctions.times],
 	shortpages: ['&list=querypage&qplimit=10&qppage=Shortpages', queryfunctions.size],
 	shortpages: ['&list=querypage&qplimit=10&qppage=Shortpages', queryfunctions.size],
 	uncategorizedcategories: ['&list=querypage&qplimit=10&qppage=Uncategorizedcategories', queryfunctions.title],
 	uncategorizedcategories: ['&list=querypage&qplimit=10&qppage=Uncategorizedcategories', queryfunctions.title],
 	uncategorizedpages: ['&list=querypage&qplimit=10&qppage=Uncategorizedpages', queryfunctions.title],
 	uncategorizedpages: ['&list=querypage&qplimit=10&qppage=Uncategorizedpages', queryfunctions.title],
@@ -74,24 +73,40 @@ var querypages = {
 	uncategorizedtemplates: ['&list=querypage&qplimit=10&qppage=Uncategorizedtemplates', queryfunctions.title],
 	uncategorizedtemplates: ['&list=querypage&qplimit=10&qppage=Uncategorizedtemplates', queryfunctions.title],
 	unusedcategories: ['&list=querypage&qplimit=10&qppage=Unusedcategories', queryfunctions.title],
 	unusedcategories: ['&list=querypage&qplimit=10&qppage=Unusedcategories', queryfunctions.title],
 	unusedimages: ['&list=querypage&qplimit=10&qppage=Unusedimages', queryfunctions.title],
 	unusedimages: ['&list=querypage&qplimit=10&qppage=Unusedimages', queryfunctions.title],
+	unusedtemplates: ['&list=querypage&qplimit=10&qppage=Unusedtemplates', queryfunctions.title],
+	unwatchedpages: ['&list=querypage&qplimit=10&qppage=Unwatchedpages', queryfunctions.title],
 	wantedcategories: ['&list=querypage&qplimit=10&qppage=Wantedcategories', queryfunctions.times],
 	wantedcategories: ['&list=querypage&qplimit=10&qppage=Wantedcategories', queryfunctions.times],
 	wantedfiles: ['&list=querypage&qplimit=10&qppage=Wantedfiles', queryfunctions.times],
 	wantedfiles: ['&list=querypage&qplimit=10&qppage=Wantedfiles', queryfunctions.times],
 	wantedpages: ['&list=querypage&qplimit=10&qppage=Wantedpages', queryfunctions.times],
 	wantedpages: ['&list=querypage&qplimit=10&qppage=Wantedpages', queryfunctions.times],
 	wantedtemplates: ['&list=querypage&qplimit=10&qppage=Wantedtemplates', queryfunctions.times],
 	wantedtemplates: ['&list=querypage&qplimit=10&qppage=Wantedtemplates', queryfunctions.times],
-	unwatchedpages: ['&list=querypage&qplimit=10&qppage=Unwatchedpages', queryfunctions.title],
-	unusedtemplates: ['&list=querypage&qplimit=10&qppage=Unusedtemplates', queryfunctions.title],
 	withoutinterwiki: ['&list=querypage&qplimit=10&qppage=Withoutinterwiki', queryfunctions.title],
 	withoutinterwiki: ['&list=querypage&qplimit=10&qppage=Withoutinterwiki', queryfunctions.title],
+	gadgetusage: ['&list=querypage&qplimit=10&qppage=GadgetUsage', queryfunctions.gadget],
+	recentchanges: ['&list=recentchanges&rctype=edit|new|log&rclimit=10', queryfunctions.recentchanges],
+	disambiguations: ['&list=querypage&qplimit=10&qppage=Disambiguations', queryfunctions.title],
 	mostpopularcategories: ['&list=querypage&qplimit=10&qppage=Mostpopularcategories', queryfunctions.category],
 	mostpopularcategories: ['&list=querypage&qplimit=10&qppage=Mostpopularcategories', queryfunctions.category],
-	mostimagesincontent: ['&list=querypage&qplimit=10&qppage=MostLinkedFilesInContent', queryfunctions.times],
+	mostlinkedfilesincontent: ['&list=querypage&qplimit=10&qppage=MostLinkedFilesInContent', queryfunctions.times],
 	unusedvideos: ['&list=querypage&qplimit=10&qppage=UnusedVideos', queryfunctions.title],
 	unusedvideos: ['&list=querypage&qplimit=10&qppage=UnusedVideos', queryfunctions.title],
 	withoutimages: ['&list=querypage&qplimit=10&qppage=Withoutimages', queryfunctions.title],
 	withoutimages: ['&list=querypage&qplimit=10&qppage=Withoutimages', queryfunctions.title],
 	nonportableinfoboxes: ['&list=querypage&qplimit=10&qppage=Nonportableinfoboxes', queryfunctions.title],
 	nonportableinfoboxes: ['&list=querypage&qplimit=10&qppage=Nonportableinfoboxes', queryfunctions.title],
 	popularpages: ['&list=querypage&qplimit=10&qppage=Popularpages', queryfunctions.title],
 	popularpages: ['&list=querypage&qplimit=10&qppage=Popularpages', queryfunctions.title],
 	pageswithoutinfobox: ['&list=querypage&qplimit=10&qppage=Pageswithoutinfobox', queryfunctions.title],
 	pageswithoutinfobox: ['&list=querypage&qplimit=10&qppage=Pageswithoutinfobox', queryfunctions.title],
 	templateswithouttype: ['&list=querypage&qplimit=10&qppage=Templateswithouttype', queryfunctions.title],
 	templateswithouttype: ['&list=querypage&qplimit=10&qppage=Templateswithouttype', queryfunctions.title],
-	allinfoboxes: ['&list=querypage&qplimit=10&qppage=AllInfoboxes', queryfunctions.title],
-	gadgetusage: ['&list=querypage&qplimit=10&qppage=GadgetUsage', queryfunctions.gadget],
-	recentchanges: ['&list=recentchanges&rctype=edit|new|log&rclimit=10', queryfunctions.recentchanges]
+	allinfoboxes: ['&list=querypage&qplimit=10&qppage=AllInfoboxes', queryfunctions.title]
+}
+
+const descriptions = {
+	checkuser: 'checkuser-summary&amargs=16|19',
+	resettokens: 'resettokens-text',
+	allmessages: 'allmessagestext',
+	expandtemplates: 'expand_templates_intro',
+	apisandbox: 'apisandbox-intro',
+	abusefilter: 'abusefilter-intro',
+	gadgets: 'gadgets-pagetext',
+	categorytree: 'categorytree-header',
+	drafts: 'drafts-view-summary&amargs=30',
+	analytics: 'analytics_confidential',
+	mostlinkedfilesincontent: 'mostimagesincontent-summary',
+	popularpages: 'insights-list-description-popularpages'
 }
 }
 
 
 /**
 /**
@@ -111,7 +126,7 @@ function special_page(lang, msg, title, specialpage, embed, wiki, reaction, spoi
 		overwrites[specialpage](this, lang, msg, wiki, reaction, spoiler, args, embed);
 		overwrites[specialpage](this, lang, msg, wiki, reaction, spoiler, args, embed);
 		return;
 		return;
 	}
 	}
-	got.get( wiki + 'api.php?action=query&meta=siteinfo|allmessages&siprop=general&amenableparser=true&amtitle=' + encodeURIComponent( title ) + '&ammessages=' + encodeURIComponent( specialpage ) + '-summary' + ( specialpage in querypages ? querypages[specialpage][0] : '' ) + '&format=json', {
+	got.get( wiki + 'api.php?action=query&meta=siteinfo|allmessages&siprop=general&amenableparser=true&amtitle=' + encodeURIComponent( title ) + '&ammessages=' + ( specialpage in descriptions ? descriptions[specialpage] : encodeURIComponent( specialpage ) + '-summary' ) + ( specialpage in querypages ? querypages[specialpage][0] : '' ) + '&format=json', {
 		responseType: 'json'
 		responseType: 'json'
 	} ).then( response => {
 	} ).then( response => {
 		var body = response.body;
 		var body = response.body;

+ 1 - 1
i18n/de.json

@@ -5,7 +5,6 @@
 	"fallback": [
 	"fallback": [
 		"en"
 		"en"
 	],
 	],
-	"dateformat": "de-DE",
 	"aliases": {
 	"aliases": {
 		"help": ["hilfe"],
 		"help": ["hilfe"],
 		"page": ["seite"],
 		"page": ["seite"],
@@ -17,6 +16,7 @@
 		"command": ["befehl"],
 		"command": ["befehl"],
 		"bug": ["fehler"]
 		"bug": ["fehler"]
 	},
 	},
+	"dateformat": "de-DE",
 	"prefix": "das Präfix für diesen Server ist `$1`. Du kannst das Präfix mit `$1settings prefix` ändern. Für eine Liste aller Befehle nutze `$1hilfe`.",
 	"prefix": "das Präfix für diesen Server ist `$1`. Du kannst das Präfix mit `$1settings prefix` ändern. Für eine Liste aller Befehle nutze `$1hilfe`.",
 	"missingperm": "mir fehlen einige Berechtigungen für diesen Befehl:",
 	"missingperm": "mir fehlen einige Berechtigungen für diesen Befehl:",
 	"limit": "🚨 **Stop, du hast ein Limit erreicht!** 🚨\n\n$1, deine Nachricht enthält zu viele Befehle!",
 	"limit": "🚨 **Stop, du hast ein Limit erreicht!** 🚨\n\n$1, deine Nachricht enthält zu viele Befehle!",

+ 1 - 1
i18n/en.json

@@ -5,12 +5,12 @@
 	],
 	],
 	"fallback": [
 	"fallback": [
 	],
 	],
-	"dateformat": "en-US",
 	"aliases": {
 	"aliases": {
 		"random": ["random", "🎲"],
 		"random": ["random", "🎲"],
 		"discussion": ["discussions"],
 		"discussion": ["discussions"],
 		"command": ["command", "cmd"]
 		"command": ["command", "cmd"]
 	},
 	},
+	"dateformat": "en-US",
 	"prefix": "the prefix for this server is `$1`. You can change the prefix with `$1settings prefix`. For a list of all commands see `$1help`.",
 	"prefix": "the prefix for this server is `$1`. You can change the prefix with `$1settings prefix`. For a list of all commands see `$1help`.",
 	"missingperm": "I'm missing some permissions for this command:",
 	"missingperm": "I'm missing some permissions for this command:",
 	"limit": "🚨 **Stop, you hit a limit!** 🚨\n\n$1, your message contained too many commands!",
 	"limit": "🚨 **Stop, you hit a limit!** 🚨\n\n$1, your message contained too many commands!",

+ 1 - 1
i18n/fr.json

@@ -6,12 +6,12 @@
 	"fallback": [
 	"fallback": [
 		"en"
 		"en"
 	],
 	],
-	"dateformat": "fr-FR",
 	"aliases": {
 	"aliases": {
 		"help": ["aide"],
 		"help": ["aide"],
 		"search": ["chercher"],
 		"search": ["chercher"],
 		"command": ["commande"]
 		"command": ["commande"]
 	},
 	},
+	"dateformat": "fr-FR",
 	"prefix": "le préfixe pour ce serveur est `$1`. Vous pouvez changer le préfixe avec `$1settings prefix`. Pour une liste de toutes les commandes, voir `$1help`.",
 	"prefix": "le préfixe pour ce serveur est `$1`. Vous pouvez changer le préfixe avec `$1settings prefix`. Pour une liste de toutes les commandes, voir `$1help`.",
 	"missingperm": "Il me manque certaines permissions pour cette commande :",
 	"missingperm": "Il me manque certaines permissions pour cette commande :",
 	"limit": "🚨 **Halte ! Vous avez dépassé la limite !** 🚨\n\n$1, votre message contient beaucoup trop de commandes !",
 	"limit": "🚨 **Halte ! Vous avez dépassé la limite !** 🚨\n\n$1, votre message contient beaucoup trop de commandes !",

+ 1 - 1
i18n/nl.json

@@ -5,7 +5,6 @@
 	"fallback": [
 	"fallback": [
 		"en"
 		"en"
 	],
 	],
-	"dateformat": "nl-NL",
 	"aliases": {
 	"aliases": {
 		"page": ["pagina"],
 		"page": ["pagina"],
 		"search": ["zoeken"],
 		"search": ["zoeken"],
@@ -13,6 +12,7 @@
 		"overview": ["overzicht"],
 		"overview": ["overzicht"],
 		"discussion": ["discussie"]
 		"discussion": ["discussie"]
 	},
 	},
+	"dateformat": "nl-NL",
 	"prefix": "het voorvoegsel voor deze server is `$1`. Je kunt het voorvoegsel veranderen met `$1settings prefix`. Voor een lijst van alle opdrachten zie `$1help`.",
 	"prefix": "het voorvoegsel voor deze server is `$1`. Je kunt het voorvoegsel veranderen met `$1settings prefix`. Voor een lijst van alle opdrachten zie `$1help`.",
 	"missingperm": "Ik mis een aantal permissies voor deze opdracht:",
 	"missingperm": "Ik mis een aantal permissies voor deze opdracht:",
 	"limit": "🚨 **Stop, je hebt een limiet bereikt!** 🚨\n\n$1, je bericht bevatte te veel opdrachten!",
 	"limit": "🚨 **Stop, je hebt een limiet bereikt!** 🚨\n\n$1, je bericht bevatte te veel opdrachten!",

+ 2 - 2
i18n/pl.json

@@ -6,7 +6,6 @@
 	"fallback": [
 	"fallback": [
 		"en"
 		"en"
 	],
 	],
-	"dateformat": "pl-PL",
 	"aliases": {
 	"aliases": {
 		"help": ["pomoc"],
 		"help": ["pomoc"],
 		"page": ["strona"],
 		"page": ["strona"],
@@ -14,6 +13,7 @@
 		"discussion": ["dyskusje", "dyskusja"],
 		"discussion": ["dyskusje", "dyskusja"],
 		"command": ["komenda"]
 		"command": ["komenda"]
 	},
 	},
+	"dateformat": "pl-PL",
 	"prefix": "prefiksem komend dla tego serwera jest `$1`. Możesz zmienić prefiks używając `$1settings prefix`. Lista wszystkich komend jest dostępna przez użycie `$1pomoc`.",
 	"prefix": "prefiksem komend dla tego serwera jest `$1`. Możesz zmienić prefiks używając `$1settings prefix`. Lista wszystkich komend jest dostępna przez użycie `$1pomoc`.",
 	"missingperm": "Brakuje mi uprawnień:",
 	"missingperm": "Brakuje mi uprawnień:",
 	"limit": "🚨 **Chwila moment! Osiągnięto limit!** 🚨\n\n$1, Twoja wiadomość zawiera zbyt wiele komend!",
 	"limit": "🚨 **Chwila moment! Osiągnięto limit!** 🚨\n\n$1, Twoja wiadomość zawiera zbyt wiele komend!",
@@ -185,7 +185,7 @@
 			"hydra_staff": "personel Gamepedii",
 			"hydra_staff": "personel Gamepedii",
 			"wiki_manager": "Menedżer wiki",
 			"wiki_manager": "Menedżer wiki",
 			"content_team_member": "Członek Zespołu Treści",
 			"content_team_member": "Członek Zespołu Treści",
-			"GRASP": "GRASP",
+			"grasp": "GRASP",
 			"bot-global": "bot globalny",
 			"bot-global": "bot globalny",
 			"staff": "Fandom Staff",
 			"staff": "Fandom Staff",
 			"wiki-manager": "Menedżer wiki",
 			"wiki-manager": "Menedżer wiki",

+ 1 - 1
i18n/pt.json

@@ -7,7 +7,6 @@
 	"fallback": [
 	"fallback": [
 		"en"
 		"en"
 	],
 	],
-	"dateformat": "pt-PT",
 	"aliases": {
 	"aliases": {
 		"help": ["ajuda"],
 		"help": ["ajuda"],
 		"test": ["teste"],
 		"test": ["teste"],
@@ -17,6 +16,7 @@
 		"command": ["comando"],
 		"command": ["comando"],
 		"bug": ["erro"]
 		"bug": ["erro"]
 	},
 	},
+	"dateformat": "pt-PT",
 	"prefix": "o prefixo deste servidor é `$1`. Você pode alterar o prefixo com `$1settings prefix`. Para uma lista de todos os comandos, veja `$1help`.",
 	"prefix": "o prefixo deste servidor é `$1`. Você pode alterar o prefixo com `$1settings prefix`. Para uma lista de todos os comandos, veja `$1help`.",
 	"missingperm": "eu estou perdendo algumas permissões para este comando:",
 	"missingperm": "eu estou perdendo algumas permissões para este comando:",
 	"limit": "🚨 **Pare, você atingiu um limite!** 🚨\n\n$1, sua mensagem continha muitos comandos!",
 	"limit": "🚨 **Pare, você atingiu um limite!** 🚨\n\n$1, sua mensagem continha muitos comandos!",

+ 1 - 1
i18n/ru.json

@@ -6,11 +6,11 @@
 	"fallback": [
 	"fallback": [
 		"en"
 		"en"
 	],
 	],
-	"dateformat": "ru-RU",
 	"aliases": {
 	"aliases": {
 		"page": ["страница"],
 		"page": ["страница"],
 		"search": ["поиск"]
 		"search": ["поиск"]
 	},
 	},
+	"dateformat": "ru-RU",
 	"prefix": "префикс для этого сервера `$1`. Вы можете изменить префикс, введя команду `$1settings prefix`. Чтобы получить список всех команд, введите `$1help`.",
 	"prefix": "префикс для этого сервера `$1`. Вы можете изменить префикс, введя команду `$1settings prefix`. Чтобы получить список всех команд, введите `$1help`.",
 	"missingperm": "Я потерял какие-то разрешения для выполнения команды:",
 	"missingperm": "Я потерял какие-то разрешения для выполнения команды:",
 	"limit": "🚨 **Стой, ты уперся в лимит!** 🚨\n\n$1, твое сообщение содержит очень много команд!",
 	"limit": "🚨 **Стой, ты уперся в лимит!** 🚨\n\n$1, твое сообщение содержит очень много команд!",

+ 2 - 2
i18n/tr.json

@@ -5,7 +5,6 @@
 	"fallback": [
 	"fallback": [
 		"en"
 		"en"
 	],
 	],
-	"dateformat": "tr-TR",
 	"aliases": {
 	"aliases": {
 		"info": ["bilgi"],
 		"info": ["bilgi"],
 		"help": ["yardım"],
 		"help": ["yardım"],
@@ -13,6 +12,7 @@
 		"search": ["arama"],
 		"search": ["arama"],
 		"discussion": ["tartışma"]
 		"discussion": ["tartışma"]
 	},
 	},
+	"dateformat": "tr-TR",
 	"prefix": "sunucudaki önekim `$1`. Bunu `$1settings prefix` ile değiştirebilirsin. Komutların bütün listesi için `$1yardım`.",
 	"prefix": "sunucudaki önekim `$1`. Bunu `$1settings prefix` ile değiştirebilirsin. Komutların bütün listesi için `$1yardım`.",
 	"missingperm": "Bu komutu uygulamak için ihtiyacım olan birkaç izin eksik:",
 	"missingperm": "Bu komutu uygulamak için ihtiyacım olan birkaç izin eksik:",
 	"limit": "🚨 **Dur, limite ulaştın!** 🚨\n\n$1, mesajın çok fazla komut içeriyor!",
 	"limit": "🚨 **Dur, limite ulaştın!** 🚨\n\n$1, mesajın çok fazla komut içeriyor!",
@@ -329,7 +329,7 @@
 					"cmd": "pause $1",
 					"cmd": "pause $1",
 					"desc": "Birkaç admin komutu haricinde, bu sunucudaki bütün komutları yok sayacağım."
 					"desc": "Birkaç admin komutu haricinde, bu sunucudaki bütün komutları yok sayacağım."
 				},
 				},
-				"pause": {
+				"active": {
 					"cmd": "pause $1",
 					"cmd": "pause $1",
 					"desc": "Bu sunucudaki tüm komutlara tekrar cevap vereceğim."
 					"desc": "Bu sunucudaki tüm komutlara tekrar cevap vereceğim."
 				}
 				}

+ 2 - 2
i18n/zh.json

@@ -6,12 +6,12 @@
 	"fallback": [
 	"fallback": [
 		"en"
 		"en"
 	],
 	],
-	"dateformat": "zh-CN",
 	"aliases": {
 	"aliases": {
 		"page": ["页面"],
 		"page": ["页面"],
 		"search": ["搜索"],
 		"search": ["搜索"],
 		"verify": ["验证"]
 		"verify": ["验证"]
 	},
 	},
+	"dateformat": "zh-CN",
 	"prefix": "此伺服器的命令前缀是 `$1`。你可以使用 `$1settings prefix` 更改前缀。关于全部命令,请见 `$1help`。",
 	"prefix": "此伺服器的命令前缀是 `$1`。你可以使用 `$1settings prefix` 更改前缀。关于全部命令,请见 `$1help`。",
 	"missingperm": "为执行此命令我缺少一些权限:",
 	"missingperm": "为执行此命令我缺少一些权限:",
 	"limit": "🚨 **停一下,你太快了!** 🚨\n\n$1,你发出的指令过多了。",
 	"limit": "🚨 **停一下,你太快了!** 🚨\n\n$1,你发出的指令过多了。",
@@ -445,7 +445,7 @@
 					"cmd": "verification <id> role <新身份组>",
 					"cmd": "verification <id> role <新身份组>",
 					"desc": "我将更改此验证方式的身份组。可用 `|` 来分割多个身份组。"
 					"desc": "我将更改此验证方式的身份组。可用 `|` 来分割多个身份组。"
 				},
 				},
-				"editount": {
+				"editcount": {
 					"cmd": "verification <id> editcount <新编辑数>",
 					"cmd": "verification <id> editcount <新编辑数>",
 					"desc": "我将更改验证方式的最小编辑数。"
 					"desc": "我将更改验证方式的最小编辑数。"
 				},
 				},

+ 38 - 1
util/i18n.js

@@ -74,7 +74,44 @@ class Lang {
 		return ( text || '⧼' + message + ( isDebug && args.length ? ': ' + args.join(', ') : '' ) + '⧽' );
 		return ( text || '⧼' + message + ( isDebug && args.length ? ': ' + args.join(', ') : '' ) + '⧽' );
 	}
 	}
 
 
-	static allLangs() {
+//	/**
+//	 * Get a localized message.
+//	 * @param {String} message - Name of the message.
+//	 * @param {String[]} args - Arguments for the message.
+//	 * @returns {String}
+//	 */
+//	get(message = '', ...args) {
+//		if ( this.namespace.length ) message = this.namespace + '.' + message;
+//		let lang = this.lang;
+//		let text = i18n?.[lang]?.[message];
+//		let fallback = 0;
+//		while ( !text ) {
+//			if ( fallback < this.fallback.length ) {
+//				lang = this.fallback[fallback];
+//				fallback++;
+//				text = i18n?.[lang]?.[message];
+//			}
+//			else break;
+//		}
+//		if ( typeof text === 'string' ) {
+//			args.forEach( (arg, i) => {
+//				text = text.replaceSave( new RegExp( `\\$${i + 1}`, 'g' ), arg );
+//			} );
+//			text = text.replace( /{{\s*PLURAL:\s*(\d+)\s*\|\s*([^\{\}]*?)\s*}}/g, (m, number, cases) => {
+//				return plural(lang, parseInt(number, 10), cases.split(/\s*\|\s*/));
+//			} );
+//		}
+//		return ( text || '⧼' + message + ( isDebug && args.length ? ': ' + args.join(', ') : '' ) + '⧽' );
+//	}
+
+	/**
+	 * Get names for all langauges.
+	 * @param {Boolean} isRcGcDw - Get the langauge for RcGcDw?
+	 * @returns {Object}
+	 * @static
+	 */
+	static allLangs(isRcGcDw = false) {
+		if ( isRcGcDw ) return i18n.RcGcDw;
 		return i18n.allLangs;
 		return i18n.allLangs;
 	}
 	}
 }
 }