浏览代码

Make Swedish available and small fixes

Markus-Rost 4 年之前
父节点
当前提交
f8f6bc974c
共有 4 个文件被更改,包括 9 次插入2 次删除
  1. 1 1
      cmds/test.js
  2. 1 0
      functions/parse_page.js
  3. 2 1
      functions/verify.js
  4. 5 0
      i18n/allLangs.json

+ 1 - 1
cmds/test.js

@@ -31,7 +31,7 @@ function cmd_test(lang, msg, args, line, wiki) {
 		let textList = lang.get('test.text').filter( text => text.trim() );
 		var text = ( textList[Math.floor(Math.random() * ( textList.length * 5 ))] || lang.get('test.text.0') );
 		if ( process.env.READONLY ) text = lang.get('general.readonly') + '\n' + process.env.invite;
-		console.log( '- Test: Fully functioning!' );
+		console.log( '- Test[' + global.shardId + ']: Fully functioning!' );
 		var now = Date.now();
 		msg.replyMsg( text ).then( message => {
 			if ( !message ) return;

+ 1 - 0
functions/parse_page.js

@@ -375,6 +375,7 @@ function parse_page(lang, msg, content, embed, wiki, reaction, {title, contentmo
 					if ( disambiguation !== undefined && !fragment && embed.length < 4250 ) {
 						if ( description.length > 1500 ) description = limitLength(description, 1500, 250);
 					}
+					else if ( fragment && description.length > 500 ) description = limitLength(description, 500, 250);
 					else if ( description.length > 1000 ) description = limitLength(description, 1000, 500);
 					embed.setDescription( description );
 				}

+ 2 - 1
functions/verify.js

@@ -35,7 +35,8 @@ function verify(lang, channel, member, username, wiki, rows, old_username = '')
 				console.log( '- This wiki doesn\'t exist!' );
 				result.reaction = 'nowiki';
 			}
-			else if ( body?.error?.code === 'us400' ) { // special catch for Fandom
+			else if ( body?.error?.code === 'us400' || body?.error?.code === 'baduser_ucuser' ) {
+				// special catch for Fandom
 				if ( !old_username ) logging(wiki, channel.guild.id, 'verification');
 				embed.setTitle( escapeFormatting( old_username || username ) ).setColor('#0000FF').setDescription( lang.get('verify.user_missing', escapeFormatting( old_username || username )) ).addField( lang.get('verify.notice'), lang.get('verify.help_missing') );
 				result.content = lang.get('verify.user_missing_reply', escapeFormatting( old_username || username ));

+ 5 - 0
i18n/allLangs.json

@@ -11,6 +11,7 @@
 			"pl": "Polski (pl)",
 			"pt-br": "Português do Brasil (pt-br)",
 			"ru": "Русский (ru)",
+			"sv": "Svenska (sv)",
 			"tr": "Türkçe (tr)",
 			"zh-hans": "简体中文 (zh-hans)",
 			"zh-hant": "繁體中文 (zh-hant)"
@@ -63,6 +64,10 @@
 			"russian": "ru",
 			"русский": "ru",
 			"русский (ru)": "ru",
+			"sv": "sv",
+			"swedish": "sv",
+			"svenska": "sv",
+			"svenska (sv)": "sv",
 			"tr": "tr",
 			"turkish": "tr",
 			"turkçe": "tr",