Parcourir la source

avoid cache when fetching discord tag

Markus-Rost il y a 5 ans
Parent
commit
ba810dbec2
4 fichiers modifiés avec 7 ajouts et 7 suppressions
  1. 1 1
      i18n/de.json
  2. 1 1
      i18n/en.json
  3. 1 1
      i18n/pt.json
  4. 4 4
      main.js

+ 1 - 1
i18n/de.json

@@ -142,7 +142,7 @@
 		"notice": "Hinweis:",
 		"qualified": "Qualifiziert für:",
 		"qualified_error": "Qualifiziert für, aber konnte nicht hinzugefügt werden:",
-		"help_guide": "Folge [dieser Anleitung](%s) um dein Discord-Tag auf deinem Wiki-Profil hinzuzufügen.",
+		"help_guide": "Folge [dieser Anleitung](%s) um dein Discord-Tag auf deinem Wiki-Profil hinzuzufügen:",
 		"help_gamepedia": "https://help-de.gamepedia.com/Discord",
 		"help_fandom": "https://community.fandom.com/wiki/Special:VerifyUser"
 	},

+ 1 - 1
i18n/en.json

@@ -137,7 +137,7 @@
 		"notice": "Notice:",
 		"qualified": "Qualified for:",
 		"qualified_error": "Qualified for, but could not add:",
-		"help_guide": "Follow [this guide](%s) to add your Discord tag to your wiki profile.",
+		"help_guide": "Follow [this guide](%s) to add your Discord tag to your wiki profile:",
 		"help_gamepedia": "https://help.gamepedia.com/Discord",
 		"help_fandom": "https://community.fandom.com/wiki/Special:VerifyUser"
 	},

+ 1 - 1
i18n/pt.json

@@ -142,7 +142,7 @@
 		"notice": "Aviso:",
 		"qualified": "Qualificado para:",
 		"qualified_error": "Qualificado para, mas não foi possível adicionar:",
-		"help_guide": "Siga [esse guia](%s) para adicionar seu nome de usuário do Discord ao seu perfil wiki.",
+		"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"
 	},

+ 4 - 4
main.js

@@ -2215,10 +2215,10 @@ function cmd_verify(lang, msg, args, line, wiki) {
 			} ).then( () => {
 				var options = {responseType: 'json'};
 				if ( wiki.endsWith( '.gamepedia.com/' ) ) {
-					url = wiki + 'api.php?action=profile&do=getPublicProfile&user_name=' + encodeURIComponent( username ) + '&format=json';
+					url = wiki + 'api.php?action=profile&do=getPublicProfile&user_name=' + encodeURIComponent( username ) + '&format=json&cache=' + Date.now();
 				}
 				else if ( wiki.isFandom() ) {
-					url = 'https://services.fandom.com/user-attribute/user/' + queryuser.userid + '/attr/discordHandle?format=json';
+					url = 'https://services.fandom.com/user-attribute/user/' + queryuser.userid + '/attr/discordHandle?format=json&cache=' + Date.now();
 					options.headers = {Accept: 'application/hal+json'};
 				}
 				got.get( url, options ).then( presponse => {
@@ -2239,8 +2239,8 @@ 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=wb&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 ) );
+						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;
+						if ( help_link.length ) embed.addField( lang.verify.notice, lang.verify.help_guide.replaceSave( '%s', help_link ) + '\n' + help_link );
 						return msg.replyMsg( lang.verify.user_failed_reply.replaceSave( '%s', username.escapeFormatting() ), {embed}, false, false );
 					}