瀏覽代碼

minor fixes, pt translation

Markus-Rost 5 年之前
父節點
當前提交
29071b427f
共有 3 個文件被更改,包括 34 次插入30 次删除
  1. 8 8
      README.md
  2. 6 2
      bot.js
  3. 20 20
      i18n/pt.json

+ 8 - 8
README.md

@@ -30,8 +30,8 @@ For a full list with all commands use `!wiki help`
 | `!wiki diff <page name>` | **Wiki-Bot** will answer with a link to the last diff on the article in the wiki. |
 | `!wiki random` | **Wiki-Bot** will answer with a link to a random page in the wiki. |
 | `!wiki overview` | **Wiki-Bot** will show some information and statistics about the wiki. |
-| `!wiki discussion <search term>` | **Wiki-Bot** will answer with a link to a matching discussion thread in the Fandom wiki.
-| `!wiki discussion post <search term>` | **Wiki-Bot** will answer with a link to a matching discussion post in the Fandom wiki.
+| `!wiki discussion <search term>` | **Wiki-Bot** will answer with a link to a matching discussion thread in the Fandom wiki. |
+| `!wiki discussion post <search term>` | **Wiki-Bot** will answer with a link to a matching discussion post in the Fandom wiki. |
 | `!wiki info` | **Wiki-Bot** will introduce himself. |
 | `!wiki help` | **Wiki-Bot** will list all the commands that he understands. |
 | `!wiki help <bot command>` | **Wiki-Bot** will explain the command. |
@@ -65,12 +65,12 @@ For a full list with all administrator commands use `!wiki help admin`
 Using the `!wiki verify <wiki username>` command, users are able to verify themselves as a specific wiki user by using the Discord field on their wiki profile. If the user matches and user verifications are set up on the server, **Wiki-Bot** will give them the roles for all verification entries they matched.
 
 Using the `!wiki verification` command, admins can add up to 10 verification entries on a server. Every verification entry allows for multiple restrictions on when a user should match the verification.
-- Channel to use the `!wiki verify` command in.
-- Role to get when matching the verification entry.
-- Required edit count on the wiki to match the verification entry.
-- Required user group to be a member of on the wiki to match the verification entry.
-- Required account age in days to match the verification entry.
-- Whether the Discord users nickname should be set to their wiki username when they match the verification entry.
+* Channel to use the `!wiki verify` command in.
+* Role to get when matching the verification entry.
+* Required edit count on the wiki to match the verification entry.
+* Required user group to be a member of on the wiki to match the verification entry.
+* Required account age in days to match the verification entry.
+* Whether the Discord users nickname should be set to their wiki username when they match the verification entry.
 
 See the [admin commands](#admin) or `!wiki help verification` on how to change the wiki verification entries on the server.
 

+ 6 - 2
bot.js

@@ -1954,7 +1954,7 @@ function cmd_verification(lang, msg, args, line, wiki) {
 		}
 		
 		var prefix = ( patreons[msg.guild.id] || process.env.prefix );
-		if ( args[0] === 'add' ) {
+		if ( args[0].toLowerCase() === 'add' ) {
 			var limit = ( msg.guild.id in patreons ? 15 : 10 );
 			if ( rows.length >= limit ) return msg.replyMsg( lang.verification.max_entries, {}, true );
 			var roles = args.slice(1).join(' ').split('|').map( role => role.replace( /^\s*<?\s*(.*?)\s*>?\s*$/, '$1' ) ).filter( role => role.length );
@@ -1964,6 +1964,7 @@ function cmd_verification(lang, msg, args, line, wiki) {
 				var new_role = '';
 				if ( /^\d+$/.test(role) ) new_role = msg.guild.roles.cache.get(role);
 				if ( !new_role ) new_role = msg.guild.roles.cache.find( gc => gc.name === role.replace( /^@/, '' ) );
+				if ( !new_role ) new_role = msg.guild.roles.cache.find( gc => gc.name.toLowerCase() === role.toLowerCase().replace( /^@/, '' ) );
 				return new_role;
 			} );
 			if ( roles.some( role => !role ) ) return msg.replyMsg( lang.verification.role_missing, {}, true );
@@ -1996,6 +1997,7 @@ function cmd_verification(lang, msg, args, line, wiki) {
 			return msg.sendChannel( '<@' + msg.author.id + '>, ' + text, {split:true}, true );
 		}
 		var row = rows.find( row => row.configid.toString() === args[0] );
+		if ( args[1] ) args[1] = args[1].toLowerCase();
 		if ( args[1] === 'delete' && !args.slice(2).join('') ) {
 			return db.run( 'DELETE FROM verification WHERE guild = ? AND configid = ?', [msg.guild.id, row.configid], function (dberror) {
 				if ( dberror ) {
@@ -2032,6 +2034,7 @@ function cmd_verification(lang, msg, args, line, wiki) {
 					var new_channel = '';
 					if ( /^\d+$/.test(channel) ) new_channel = msg.guild.channels.cache.filter( tc => tc.type === 'text' ).get(channel);
 					if ( !new_channel ) new_channel = msg.guild.channels.cache.filter( gc => gc.type === 'text' ).find( gc => gc.name === channel.replace( /^#/, '' ) );
+					if ( !new_channel ) new_channel = msg.guild.channels.cache.filter( gc => gc.type === 'text' ).find( gc => gc.name.toLowerCase() === channel.toLowerCase().replace( /^#/, '' ) );
 					return new_channel;
 				} );
 				if ( channels.some( channel => !channel ) ) return msg.replyMsg( lang.verification.channel_missing, {}, true );
@@ -2054,6 +2057,7 @@ function cmd_verification(lang, msg, args, line, wiki) {
 					var new_role = '';
 					if ( /^\d+$/.test(role) ) new_role = msg.guild.roles.cache.get(role);
 					if ( !new_role ) new_role = msg.guild.roles.cache.find( gc => gc.name === role.replace( /^@/, '' ) );
+					if ( !new_role ) new_role = msg.guild.roles.cache.find( gc => gc.name.toLowerCase() === role.toLowerCase().replace( /^@/, '' ) );
 					return new_role;
 				} );
 				if ( roles.some( role => !role ) ) return msg.replyMsg( lang.verification.role_missing, {}, true );
@@ -2328,7 +2332,7 @@ function cmd_verify(lang, msg, args, line, wiki) {
 						embed.setColor('#FFFF00').setDescription( lang.verify.user_failed.replaceSave( '%1$s', msg.member.toString() ).replaceSave( '%2$s', '[' + username.escapeFormatting() + '](' + pagelink + ')' ) );
 						var help_link = '';
 						if ( wiki.endsWith( '.gamepedia.com/' ) ) help_link = lang.verify.help_gamepedia;
-						else if ( wiki.isFandom() ) help_link = lang.verify.help_fandom + '/' + username.toTitle(true) + '?c=' + ( msg.guild.id in patreons && patreons[msg.guild.id] !== process.env.prefix ? encodeURIComponent( patreons[msg.guild.id] + ' verify' ) : 'wb' ) + '&ch=' + encodeURIComponent( msg.channel.name ) + '&user=' + encodeURIComponent( msg.author.username ) + '&tag=' + msg.author.discriminator;
+						else if ( wiki.isFandom() ) help_link = lang.verify.help_fandom + '/' + username.toTitle(true) + '?c=' + ( msg.guild.id in patreons && patreons[msg.guild.id] !== process.env.prefix ? encodeURIComponent( patreons[msg.guild.id] + ' verify' ) : 'wb' ) + ( msg.channel.name !== 'verification' ? '&ch=' + encodeURIComponent( msg.channel.name ) : '' ) + '&user=' + encodeURIComponent( msg.author.username ) + '&tag=' + msg.author.discriminator;
 						if ( help_link.length ) embed.addField( lang.verify.notice, lang.verify.help_guide.replaceSave( '%s', help_link ) + '\n' + help_link );
 						msg.replyMsg( lang.verify.user_failed_reply.replaceSave( '%s', username.escapeFormatting() ), {embed}, false, false );
 						

+ 20 - 20
i18n/pt.json

@@ -93,17 +93,17 @@
 		"delete_current": "Excluir esta verificação:",
 		"channel": "Canal:",
 		"role": "Função:",
-		"editcount": "Editar contagem:",
+		"editcount": "Contagem de edições:",
 		"usergroup": "Grupo de usuários:",
 		"or": "ou",
 		"and": "e",
 		"accountage": "Idade da conta:",
 		"indays": "(em dias)",
-		"rename": "Change nickname:",
-		"enabled": "enabled",
-		"disabled": "disabled",
-		"toggle": "(toggle)",
-		"rename_no_permission": "**%s is missing the `Manage Nicknames` permission to force wiki usernames!**",
+		"rename": "Mudar apelido:",
+		"enabled": "ativado",
+		"disabled": "desativado",
+		"toggle": "(alternancia)",
+		"rename_no_permission": "**%s está faltando a permissão `Gerenciar apelidos` para forçar os nomes de usuário da wiki!**",
 		"role_too_high": "**A função %1$s é muito alto para %2$s para atribuir!**",
 		"channel_max": "muitos canais fornecidos.",
 		"channel_missing": "o canal fornecido não existe.",
@@ -126,7 +126,7 @@
 		"footer": "Verificação de conta da wiki",
 		"failed_gblock": "**Falha na verificação de bloqueio global!**",
 		"failed_roles": "**A adição de funções falhou!**",
-		"failed_rename": "**Changing the nickname failed!**",
+		"failed_rename": "**A alteração do apelido falhou!**",
 		"audit_reason": "Verificado como \"%s\"",
 		"user_missing": "O usuário da wiki \"%s\" não existe.",
 		"user_missing_reply": "seu usuário da wiki vinculado \"%s\" não existe.",
@@ -142,7 +142,7 @@
 		"user_matches_reply": "seu nome de usuário do Discord corresponde ao usuário da wiki \"%s\", mas você não atende aos requisitos para nenhuma função.",
 		"user_verified": "Usuário do Discord %1$s foi verificado com sucesso como usuário da wiki %2$s.",
 		"user_verified_reply": "você foi verificado com sucesso como usuário da wiki \"%s\".",
-		"user_renamed": "Their Discord nickname has been changed to their wiki username.",
+		"user_renamed": "O apelido do Discord foi alterado para o nome de usuário da wiki.",
 		"discord": "Usuário do Discord:",
 		"wiki": "Usuário da wiki:",
 		"empty": "*vazio*",
@@ -152,7 +152,7 @@
 		"help_guide": "Siga [esse guia](%s) para adicionar seu nome de usuário do Discord ao seu perfil wiki:",
 		"help_gamepedia": "https://help-pt.gamepedia.com/Discord",
 		"help_fandom": "https://community.fandom.com/wiki/Special:VerifyUser",
-		"help_subpage": "Please add your Discord tag (%s) to your Discord subpage on the wiki:"
+		"help_subpage": "Adicione seu nome de usuário do Discord (%s) para sua subpágina Discord na wiki:"
 	},
 	"overview": {
 		"inaccurate": "Estatísticas podem ser imprecisas",
@@ -360,17 +360,17 @@
 			{ "cmd": "settings inline toggle", "desc": "I will toggle inline commands for this server.", "hide": true, "admin": true },
 			{ "cmd": "settings wiki <wiki>", "desc": "Vou mudar a wiki padrão para esse servidor.", "hide": true, "admin": true },
 			{ "cmd": "settings channel", "desc": "Vou mudar as substituições para o canal atual.", "hide": true, "admin": true },
-			{ "cmd": "verify <wiki username>", "desc": "Use this command to verify your Discord account with your wiki account and get roles matching your wiki account.", "hide": true },
-			{ "cmd": "verification", "desc": "I will change the wiki verifications used by the `@prefix verify` command.", "admin": true, "pause": true },
-			{ "cmd": "help verification", "desc": "I will explain in more detail how the verification command works.", "unsearchable": true, "admin": true },
-			{ "cmd": "verification add <role>", "desc": "I will add a new wiki verification. Accepts a `|` separated list.", "hide": true, "admin": true },
-			{ "cmd": "verification <id> channel <new channel>", "desc": "I will update the channel for the wiki verification. Accepts a `|` separated list.", "hide": true, "admin": true },
-			{ "cmd": "verification <id> role <new role>", "desc": "I will update the role for the wiki verification. Accepts a `|` separated list.", "hide": true, "admin": true },
-			{ "cmd": "verification <id> editcount <new edit count>", "desc": "I will update the minimal edit count for the wiki verification.", "hide": true, "admin": true },
-			{ "cmd": "verification <id> usergroup <new user group>", "desc": "I will update the user group for the wiki verification. Accepts a `|` separated list.\n\t• Provide `AND` as the first list entry to make all provided user groups required.", "hide": true, "admin": true },
-			{ "cmd": "verification <id> accountage <new account age>", "desc": "I will update the minimal account age (in days) for the wiki verification.", "hide": true, "admin": true },
-			{ "cmd": "verification <id> rename", "desc": "I will change if the users Discord nickname should be changed to their wiki username for the wiki verification.", "hide": true, "admin": true },
-			{ "cmd": "verification <id> delete", "desc": "I will delete the wiki verification.", "hide": true, "admin": true },
+			{ "cmd": "verify <wiki username>", "desc": "Use este comando para verificar sua conta do Discord com a sua conta wiki e obter funções correspondentes à sua conta na wiki.", "hide": true },
+			{ "cmd": "verification", "desc": "Vou mudar as verificações da wiki usadas pelo comando `@prefix verify`.", "admin": true, "pause": true },
+			{ "cmd": "help verification", "desc": "Vou explicar mais detalhadamente como o comando de verificação funciona.", "unsearchable": true, "admin": true },
+			{ "cmd": "verification add <função>", "desc": "Vou adicionar uma nova verificação da wiki. Aceita uma `|` lista separada.", "hide": true, "admin": true },
+			{ "cmd": "verification <id> channel <novo canal>", "desc": "Vou mudar o canal para a verificação da wiki. Aceita uma `|` lista separada.", "hide": true, "admin": true },
+			{ "cmd": "verification <id> role <nova função>", "desc": "Vou mudar o papel da verificação do wiki. Aceita uma `|` lista separada.", "hide": true, "admin": true },
+			{ "cmd": "verification <id> editcount <nova contagem de edições>", "desc": "Vou alterar a contagem mínima de edições para a verificação da wiki.", "hide": true, "admin": true },
+			{ "cmd": "verification <id> usergroup <novo grupo de usuários>", "desc": "Vou mudar o grupo de usuários para a verificação da wiki. Aceita uma `|` lista separada.\n\t• Fornecer `AND` como a primeira entrada da lista para tornar todos os grupos de usuários fornecidos necessários.", "hide": true, "admin": true },
+			{ "cmd": "verification <id> accountage <idade da nova conta>", "desc": "Vou alterar a idade mínima da conta (em dias) para a verificação da wiki.", "hide": true, "admin": true },
+			{ "cmd": "verification <id> rename", "desc": "Eu mudarei se o apelido do Discord dos usuários for alterado para o nome de usuário do wiki para a verificação da wiki.", "hide": true, "admin": true },
+			{ "cmd": "verification <id> delete", "desc": "Vou excluir a verificação da wiki.", "hide": true, "admin": true },
 			{ "cmd": "voice", "desc": "Eu tento dar a todos em um canal de voz um papel específico.", "admin": true, "pause": true },
 			{ "cmd": "pause @mention", "desc": "Eu vou ignorar todos os comandos neste servidor, exceto alguns comandos de administração.", "admin": true },
 			{ "cmd": "pause @mention", "desc": "Eu responderei a todos os comandos neste servidor novamente.", "unsearchable": true, "hide": true, "pause": true },