1
0
Эх сурвалжийг харах

Multiple long wanted improvements

Markus-Rost 4 жил өмнө
parent
commit
b16303933f

+ 3 - 3
cmds/wiki/diff.js

@@ -147,7 +147,7 @@ function gamepedia_diff(lang, msg, args, wiki, reaction, spoiler, embed) {
  * @param {String[]} [compare] - The edit difference.
  */
 function gamepedia_diff_send(lang, msg, args, wiki, reaction, spoiler, compare) {
-	got.get( wiki + 'api.php?action=query&meta=siteinfo&siprop=general&list=tags&tglimit=500&tgprop=displayname&prop=revisions&rvslots=main&rvprop=ids|timestamp|flags|user|size|comment|tags' + ( args.length === 1 || args[0] === args[1] ? '|content' : '' ) + '&revids=' + args.join('|') + '&format=json' ).then( response => {
+	got.get( wiki + 'api.php?action=query&meta=siteinfo&siprop=general&list=tags&tglimit=500&tgprop=displayname&prop=revisions&rvslots=main&rvprop=ids|timestamp|flags|user|size|parsedcomment|tags' + ( args.length === 1 || args[0] === args[1] ? '|content' : '' ) + '&revids=' + args.join('|') + '&format=json' ).then( response => {
 		var body = response.body;
 		if ( body && body.warnings ) log_warn(body.warnings);
 		if ( response.statusCode !== 200 || !body || body.batchcomplete === undefined || !body.query ) {
@@ -194,8 +194,8 @@ function gamepedia_diff_send(lang, msg, args, wiki, reaction, spoiler, compare)
 			}
 			var timestamp = [lang.get('diff.info.timestamp'), dateformat.format(new Date(revisions[0].timestamp))];
 			var difference = revisions[0].size - ( revisions[1] ? revisions[1].size : 0 );
-			var size = [lang.get('diff.info.size'), lang.get('diff.info.bytes', ( difference > 0 ? '+' : '' ) + difference.toLocaleString(lang.get('dateformat')), difference)];
-			var comment = [lang.get('diff.info.comment'), ( revisions[0].commenthidden !== undefined ? lang.get('diff.hidden') : ( revisions[0].comment ? toFormatting(revisions[0].comment, msg.showEmbed(), wiki, title) : lang.get('diff.nocomment') ) )];
+			var size = [lang.get('diff.info.size'), lang.get('diff.info.bytes', ( difference > 0 ? '+' : '' ) + difference.toLocaleString(lang.get('dateformat')), difference, ( revisions[0].minor !== undefined ? lang.get('diff.info.minor') : '' ))];
+			var comment = [lang.get('diff.info.comment'), ( revisions[0].commenthidden !== undefined ? lang.get('diff.hidden') : ( revisions[0].parsedcomment ? ( msg.showEmbed() ? htmlToDiscord(revisions[0].parsedcomment, wiki.toLink(title), true) : htmlToPlain(revisions[0].parsedcomment) ) : lang.get('diff.nocomment') ) )];
 			if ( revisions[0].tags.length ) var tags = [lang.get('diff.info.tags'), body.query.tags.filter( tag => revisions[0].tags.includes( tag.name ) ).map( tag => tag.displayname ).join(', ')];
 			
 			var pagelink = wiki.toLink(title, {diff,oldid});

+ 128 - 54
cmds/wiki/user.js

@@ -1,4 +1,5 @@
 const {MessageEmbed} = require('discord.js');
+const datetimeDifference = require('datetime-difference');
 const global_block = require('../../functions/global_block.js');
 const parse_page = require('../../functions/parse_page.js');
 const logging = require('../../util/logging.js');
@@ -83,22 +84,72 @@ function gamepedia_user(lang, msg, namespace, username, wiki, querystring, fragm
 			}, timeoptions));
 		}
 		var blocks = body.query.blocks.map( block => {
+			var isIndef = false;
 			var isBlocked = false;
-			var blockedtimestamp = dateformat.format(new Date(block.timestamp));
-			var blockexpiry = block.expiry;
-			if ( ['infinite', 'indefinite', 'infinity', 'never'].includes(blockexpiry) ) {
-				blockexpiry = lang.get('user.block.until_infinity');
+			var blockedtimestamp = new Date(block.timestamp);
+			var blockduration = '';
+			var blockexpiry = '';
+			if ( ['infinite', 'indefinite', 'infinity', 'never'].includes(block.expiry) ) {
+				isIndef = true;
 				isBlocked = true;
-			} else if ( blockexpiry ) {
-				if ( Date.parse(blockexpiry) > Date.now() ) isBlocked = true;
-				blockexpiry = dateformat.format(new Date(blockexpiry));
+			} else if ( block.expiry ) {
+				if ( Date.parse(block.expiry) > Date.now() ) isBlocked = true;
+				let expiry = new Date(block.expiry);
+				let datediff = datetimeDifference(blockedtimestamp, expiry);
+				let seperator = lang.get('user.block.duration.seperator_last').replace( /_/g, ' ' );
+				let last_seperator = true;
+				if ( datediff.minutes ) blockduration = lang.get('user.block.duration.minutes', datediff.minutes);
+				if ( datediff.hours ) {
+					blockduration = lang.get('user.block.duration.hours', datediff.hours) + ( blockduration.length ? seperator + blockduration : '' );
+					if ( last_seperator ) {
+						seperator = lang.get('user.block.duration.seperator').replace( /_/g, ' ' );
+						last_seperator = false;
+					}
+				}
+				if ( datediff.days ) {
+					if ( datediff.days % 7 ) {
+						blockduration = lang.get('user.block.duration.days', datediff.days % 7) + ( blockduration.length ? seperator + blockduration : '' );
+						if ( last_seperator ) {
+							seperator = lang.get('user.block.duration.seperator').replace( /_/g, ' ' );
+							last_seperator = false;
+						}
+					}
+					if ( ( datediff.days / 7 ) >> 0 ) {
+						blockduration = lang.get('user.block.duration.weeks', ( datediff.days / 7 ) >> 0 ) + ( blockduration.length ? seperator + blockduration : '' );
+						if ( last_seperator ) {
+							seperator = lang.get('user.block.duration.seperator').replace( /_/g, ' ' );
+							last_seperator = false;
+						}
+					}
+				}
+				if ( datediff.months ) {
+					blockduration = lang.get('user.block.duration.months', datediff.months) + ( blockduration.length ? seperator + blockduration : '' );
+					if ( last_seperator ) {
+						seperator = lang.get('user.block.duration.seperator').replace( /_/g, ' ' );
+						last_seperator = false;
+					}
+				}
+				if ( datediff.years ) {
+					blockduration = lang.get('user.block.duration.years', datediff.years) + ( blockduration.length ? seperator + blockduration : '' );
+					if ( last_seperator ) {
+						seperator = lang.get('user.block.duration.seperator').replace( /_/g, ' ' );
+						last_seperator = false;
+					}
+				}
+				blockexpiry = dateformat.format(expiry);
+			}
+			if ( isBlocked ) {
+				var text = 'user.block.' + ( isIndef ? 'indef_' : '' ) + ( block.reason ? 'text' : 'noreason' );
+				if ( msg.showEmbed() ) {
+					text = lang.get(text, dateformat.format(blockedtimestamp), blockduration, blockexpiry, '[' + block.by.escapeFormatting() + '](' + wiki.toLink('User:' + block.by, '', '', true) + ')', toMarkdown(block.reason, wiki));
+				}
+				else {
+					text = lang.get(text, dateformat.format(blockedtimestamp), blockduration, blockexpiry, block.by.escapeFormatting(), toPlaintext(block.reason));
+				}
+				return {
+					header: lang.get('user.block.header', block.user, 'unknown').escapeFormatting(), text
+				};
 			}
-			if ( isBlocked ) return {
-				header: lang.get('user.block.header', block.user, 'unknown').escapeFormatting(),
-				text: lang.get('user.block.' + ( block.reason ? 'text' : 'noreason' ), blockedtimestamp, blockexpiry),
-				by: block.by,
-				reason: block.reason
-			};
 		} ).filter( block => block !== undefined );
 		if ( username.includes( '/' ) ) {
 			var rangeprefix = username;
@@ -153,16 +204,12 @@ function gamepedia_user(lang, msg, namespace, username, wiki, querystring, fragm
 					embed.backupDescription = extract[0];
 				}
 				if ( blocks.length ) blocks.forEach( block => {
-					block.text = block.text.replaceSave( /\$3/g, '[' + block.by.escapeFormatting() + '](' + wiki.toLink('User:' + block.by, '', '', true) + ')' );
-					if ( block.reason ) block.text = block.text.replaceSave( /\$4/g, toMarkdown(block.reason, wiki) );
 					embed.addField( block.header, block.text );
 				} );
 			}
 			else {
 				text += '\n\n' + editcount.join(' ');
 				if ( blocks.length ) blocks.forEach( block => {
-					block.text = block.text.replaceSave( /\$3/g, block.by.escapeFormatting() );
-					if ( block.reason ) block.text = block.text.replaceSave( /\$4/g, toPlaintext(block.reason) );
 					text += '\n\n**' + block.header + '**\n' + block.text;
 				} );
 			}
@@ -318,24 +365,69 @@ function gamepedia_user(lang, msg, namespace, username, wiki, querystring, fragm
 					}
 				}
 			}
+			var isIndef = false;
 			var isBlocked = false;
-			var blockedtimestamp = ( queryuser.blockedtimestamp ? dateformat.format(new Date(queryuser.blockedtimestamp)) : 'Invalid Date' );
-			var blockexpiry = queryuser.blockexpiry;
-			if ( ['infinite', 'indefinite', 'infinity', 'never'].includes(blockexpiry) ) {
-				blockexpiry = lang.get('user.block.until_infinity');
+			var blockedtimestamp = ( queryuser.blockedtimestamp ? new Date(queryuser.blockedtimestamp) : '' );
+			var blockduration = '';
+			var blockexpiry = '';
+			if ( ['infinite', 'indefinite', 'infinity', 'never'].includes(queryuser.blockexpiry) ) {
+				isIndef = true;
 				isBlocked = true;
-			} else if ( blockexpiry ) {
-				var blockexpirydate = blockexpiry.replace( /(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2,3})/, '$1-$2-$3T$4:$5:$6Z' );
-				blockexpiry = dateformat.format(new Date(blockexpirydate));
-				if ( Date.parse(blockexpirydate) > Date.now() ) isBlocked = true;
+			} else if ( queryuser.blockexpiry && queryuser.blockedtimestamp ) {
+				let expiry = new Date(queryuser.blockexpiry.replace( /(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2,3})/, '$1-$2-$3T$4:$5:$6Z' ));
+				if ( expiry > Date.now() ) isBlocked = true;
+				let datediff = datetimeDifference(blockedtimestamp, expiry);
+				let seperator = lang.get('user.block.duration.seperator_last').replace( /_/g, ' ' );
+				let last_seperator = true;
+				if ( datediff.minutes ) blockduration = lang.get('user.block.duration.minutes', datediff.minutes);
+				if ( datediff.hours ) {
+					blockduration = lang.get('user.block.duration.hours', datediff.hours) + ( blockduration.length ? seperator + blockduration : '' );
+					if ( last_seperator ) {
+						seperator = lang.get('user.block.duration.seperator').replace( /_/g, ' ' );
+						last_seperator = false;
+					}
+				}
+				if ( datediff.days ) {
+					if ( datediff.days % 7 ) {
+						blockduration = lang.get('user.block.duration.days', datediff.days % 7) + ( blockduration.length ? seperator + blockduration : '' );
+						if ( last_seperator ) {
+							seperator = lang.get('user.block.duration.seperator').replace( /_/g, ' ' );
+							last_seperator = false;
+						}
+					}
+					else {
+						blockduration = lang.get('user.block.duration.weeks', ( datediff.days / 7 ) >> 0 ) + ( blockduration.length ? seperator + blockduration : '' );
+						if ( last_seperator ) {
+							seperator = lang.get('user.block.duration.seperator').replace( /_/g, ' ' );
+							last_seperator = false;
+						}
+					}
+				}
+				if ( datediff.months ) {
+					blockduration = lang.get('user.block.duration.months', datediff.months) + ( blockduration.length ? seperator + blockduration : '' );
+					if ( last_seperator ) {
+						seperator = lang.get('user.block.duration.seperator').replace( /_/g, ' ' );
+						last_seperator = false;
+					}
+				}
+				if ( datediff.years ) {
+					blockduration = lang.get('user.block.duration.years', datediff.years) + ( blockduration.length ? seperator + blockduration : '' );
+					if ( last_seperator ) {
+						seperator = lang.get('user.block.duration.seperator').replace( /_/g, ' ' );
+						last_seperator = false;
+					}
+				}
+				blockexpiry = dateformat.format(expiry);
+			}
+			var blockedtext = 'user.block.' + ( isIndef ? 'indef_' : '' ) + ( queryuser.blockreason ? 'text' : 'noreason' );
+			if ( msg.showEmbed() ) {
+				blockedtext = lang.get(blockedtext, ( blockedtimestamp ? dateformat.format(blockedtimestamp) : 'Invalid Date' ), blockduration, blockexpiry, '[' + queryuser.blockedby.escapeFormatting() + '](' + wiki.toLink('User:' + queryuser.blockedby, '', '', true) + ')', toMarkdown(queryuser.blockreason, wiki));
+			}
+			else {
+				blockedtext = lang.get(blockedtext, ( blockedtimestamp ? dateformat.format(blockedtimestamp) : 'Invalid Date' ), blockduration, blockexpiry, queryuser.blockedby.escapeFormatting(), toPlaintext(queryuser.blockreason));
 			}
-			var blockedby = queryuser.blockedby;
-			var blockreason = queryuser.blockreason;
 			var block = {
-				header: lang.get('user.block.header', username, queryuser.gender).escapeFormatting(),
-				text: lang.get('user.block.' + ( blockreason ? 'text' : 'noreason' ), blockedtimestamp, blockexpiry),
-				by: blockedby,
-				reason: blockreason
+				header: lang.get('user.block.header', username, queryuser.gender).escapeFormatting(), text: blockedtext
 			};
 			
 			var pagelink = wiki.toLink(namespace + username, querystring, fragment);
@@ -468,19 +560,9 @@ function gamepedia_user(lang, msg, namespace, username, wiki, querystring, fragm
 			}, error => {
 				console.log( '- Error while getting the user profile: ' + error );
 			} ).finally( () => {
-				if ( msg.showEmbed() ) {
-					if ( isBlocked ) {
-						block.text = block.text.replaceSave( /\$3/g, '[' + block.by.escapeFormatting() + '](' + wiki.toLink('User:' + block.by, '', '', true) + ')' );
-						if ( block.reason ) block.text = block.text.replaceSave( /\$4/g, toMarkdown(block.reason, wiki) );
-						embed.addField( block.header, block.text );
-					}
-				}
-				else {
-					if ( isBlocked ) {
-						block.text = block.text.replaceSave( /\$3/g, block.by.escapeFormatting() );
-						if ( block.reason ) block.text = block.text.replaceSave( /\$4/g, toPlaintext(block.reason) );
-						text += '\n\n**' + block.header + '**\n' + block.text;
-					}
+				if ( isBlocked ) {
+					if ( msg.showEmbed() ) embed.addField( block.header, block.text );
+					else text += '\n\n**' + block.header + '**\n' + block.text;
 				}
 				
 				if ( msg.channel.isGuild() && patreons[msg.guild?.id] ) {
@@ -507,16 +589,8 @@ function gamepedia_user(lang, msg, namespace, username, wiki, querystring, fragm
 				}
 			}
 			if ( isBlocked ) {
-				if ( msg.showEmbed() ) {
-					block.text = block.text.replaceSave( /\$3/g, '[' + block.by.escapeFormatting() + '](' + wiki.toLink('User:' + block.by, '', '', true) + ')' );
-					if ( block.reason ) block.text = block.text.replaceSave( /\$4/g, toMarkdown(block.reason, wiki) );
-					embed.addField( block.header, block.text );
-				}
-				else {
-					block.text = block.text.replaceSave( /\$3/g, block.by.escapeFormatting() );
-					if ( block.reason ) block.text = block.text.replaceSave( /\$4/g, toPlaintext(block.reason) );
-					text += '\n\n**' + block.header + '**\n' + block.text;
-				}
+				if ( msg.showEmbed() ) embed.addField( block.header, block.text );
+				else text += '\n\n**' + block.header + '**\n' + block.text;
 			}
 			if ( wiki.hasCentralAuth() && body.query.globaluserinfo.locked !== undefined ) {
 				if ( msg.showEmbed() ) embed.addField( '\u200b', '**' + lang.get('user.gblock.header', username, gender).escapeFormatting() + '**' );

+ 1 - 4
i18n/bn.json

@@ -682,10 +682,7 @@
     },
     "user": {
         "block": {
-            "header": "$1 এই সময় ব্ল'ক্ড!",
-            "noreason": "$1এ $3 দ্বারা $2 পর্যন্ত ব্ল'ক করা হয়েছে।",
-            "text": "কারণ \"$4\" দিয়ে $1এ $3 দ্বারা $2 পর্যন্ত ব্ল'ক করা হয়েছে।",
-            "until_infinity": "সময়ের অন্ত"
+            "header": "$1 এই সময় ব্ল'ক্ড!"
         },
         "gblock": {
             "disabled": "এই একাউন্ট বর্তমানে অক্ষম!",

+ 1 - 4
i18n/de.json

@@ -684,10 +684,7 @@
     },
     "user": {
         "block": {
-            "header": "$1 ist derzeit gesperrt!",
-            "noreason": "Gesperrt am $1 bis zum $2 von $3.",
-            "text": "Gesperrt am $1 bis zum $2 von $3 mit der Begründung „$4“.",
-            "until_infinity": "Ende aller Tage"
+            "header": "$1 ist derzeit gesperrt!"
         },
         "gblock": {
             "disabled": "Dieses Konto ist derzeit deaktiviert!",

+ 16 - 4
i18n/en.json

@@ -117,9 +117,10 @@
         "hidden": "*hidden*",
         "info": {
             "added": "Added:",
-            "bytes": "$1 {{PLURAL:$2|byte|bytes}}",
+            "bytes": "$1 {{PLURAL:$2|byte|bytes}} $3",
             "comment": "Comment:",
             "editor": "Editor:",
+            "minor": "(m)",
             "more": "And more",
             "removed": "Removed:",
             "size": "Difference:",
@@ -684,10 +685,21 @@
     },
     "user": {
         "block": {
+            "duration": {
+                "days": "$1 {{PLURAL:$1|day|days}}",
+                "hours": "$1 {{PLURAL:$1|hour|hours}}",
+                "minutes": "$1 {{PLURAL:$1|minute|minutes}}",
+                "months": "$1 {{PLURAL:$1|month|months}}",
+                "seperator": ",_",
+                "seperator_last": "_and_",
+                "weeks": "$1 {{PLURAL:$1|week|weeks}}",
+                "years": "$1 {{PLURAL:$1|year|years}}"
+            },
             "header": "$1 is currently blocked!",
-            "noreason": "Blocked on $1 until $2 by $3.",
-            "text": "Blocked on $1 until $2 by $3 with reason \"$4\".",
-            "until_infinity": "the end of all days"
+            "indef_noreason": "Blocked indefinitely on $1 by $4.",
+            "indef_text": "Blocked indefinitely on $1 by $4 with reason \"$5\".",
+            "noreason": "Blocked on $1 for $2 until $3 by $4.",
+            "text": "Blocked on $1 for $2 until $3 by $4 with reason \"$5\"."
         },
         "gblock": {
             "disabled": "This account is currently disabled!",

+ 1 - 4
i18n/es.json

@@ -682,10 +682,7 @@
     },
     "user": {
         "block": {
-            "header": "¡$1 está bloqueado actualmente!",
-            "noreason": "Bloqueado el $1 hasta $2 por $3.",
-            "text": "Bloqueado el $1 hasta $2 por $3 con motivo \"$4\".",
-            "until_infinity": "el fin de nuestros días"
+            "header": "¡$1 está bloqueado actualmente!"
         },
         "gblock": {
             "disabled": "¡Esta cuenta está actualmente deshabilitada!",

+ 1 - 4
i18n/fr.json

@@ -674,10 +674,7 @@
     },
     "user": {
         "block": {
-            "header": "$1 est actuellement bloqué !",
-            "noreason": "Bloqué le $1 jusqu'au $2 par $3.",
-            "text": "Bloqué le $1 jusqu'au $2 par $3 avec la raison « $4 ».",
-            "until_infinity": "moment de la fin des jours"
+            "header": "$1 est actuellement bloqué !"
         },
         "gblock": {
             "disabled": "Ce compte est actuellement désactivé !",

+ 1 - 4
i18n/hi.json

@@ -682,10 +682,7 @@
     },
     "user": {
         "block": {
-            "header": "$1 इस समय ब्लॉक्ड है!",
-            "noreason": "$3 द्वारा $1 को $2 तक ब्लॉक किया गया है।",
-            "text": "$3 द्वारा $1 को $2 तक \"$4\" कारण के साथ ब्लॉक किया गया है।",
-            "until_infinity": "समय का अंत"
+            "header": "$1 इस समय ब्लॉक्ड है!"
         },
         "gblock": {
             "disabled": "यह अकाउंट ग्लोबल रूप से ब्लॉक हो चुका है!",

+ 1 - 4
i18n/ko.json

@@ -682,10 +682,7 @@
     },
     "user": {
         "block": {
-            "header": "$1 사용자는 현재 차단되어 있어요!",
-            "noreason": "$3님이 $1에 $2까지 차단했어요.",
-            "text": "$3 님이 $1에 \"$4\" 이유로 $2까지 차단했어요.",
-            "until_infinity": "시간이 끝날 때까지"
+            "header": "$1 사용자는 현재 차단되어 있어요!"
         },
         "gblock": {
             "disabled": "이 계정은 비활성화되어 있어요!",

+ 1 - 4
i18n/nl.json

@@ -399,10 +399,7 @@
     },
     "user": {
         "block": {
-            "header": "$1 is momenteel geblokkeerd!",
-            "noreason": "Geblokkeerd van $1 tot $2 door $3.",
-            "text": "Geblokkeerd van $1 tot $2 door $3 met reden \"$4\".",
-            "until_infinity": "het einde van de wereld"
+            "header": "$1 is momenteel geblokkeerd!"
         },
         "gblock": {
             "disabled": "Dit account is momenteel uitgeschakeld!",

+ 1 - 4
i18n/pl.json

@@ -681,10 +681,7 @@
     },
     "user": {
         "block": {
-            "header": "$1 jest obecnie {{GENDER:$2|zablokowany|zablokowana|zablokowany(-na)}}!",
-            "noreason": "Zablokowano $1 do $2 przez $3.",
-            "text": "Zablokowano $1 do $2 przez $3 z powodem „$4”.",
-            "until_infinity": "do końca wszechświata"
+            "header": "$1 jest obecnie {{GENDER:$2|zablokowany|zablokowana|zablokowany(-na)}}!"
         },
         "gblock": {
             "disabled": "To konto jest obecnie wyłączone!",

+ 1 - 4
i18n/pt-br.json

@@ -682,10 +682,7 @@
     },
     "user": {
         "block": {
-            "header": "$1 está atualmente {{GENDER:$2|bloqueado|bloqueada}}!",
-            "noreason": "Bloqueado em $1 até $2 por $3.",
-            "text": "Bloqueado em $1 até $2 por $3 com motivo \"$4\".",
-            "until_infinity": "o fim de todos os dias"
+            "header": "$1 está atualmente {{GENDER:$2|bloqueado|bloqueada}}!"
         },
         "gblock": {
             "disabled": "Esta conta está desativada no momento!",

+ 1 - 4
i18n/ru.json

@@ -682,10 +682,7 @@
     },
     "user": {
         "block": {
-            "header": "$1 сейчас {{GENDER:$2|заблокирован|заблокирована}}!",
-            "noreason": "Заблокирован с $1 до $2 пользователем $3.",
-            "text": "Заблокирован с $1 до $2 пользователем $3 с причиной \"$4\".",
-            "until_infinity": "навсегда"
+            "header": "$1 сейчас {{GENDER:$2|заблокирован|заблокирована}}!"
         },
         "gblock": {
             "disabled": "Этот аккаунт в настоящее время отключен!",

+ 1 - 4
i18n/tr.json

@@ -681,10 +681,7 @@
     },
     "user": {
         "block": {
-            "header": "$1 şu anda engelli!",
-            "noreason": "$1 platformundan $3 tarafından $2 tarihine kadar engellendiniz.",
-            "text": "$1 platformundan $3 tarafından \"$4\" nedeniyle $2 süresinde engellendiniz.",
-            "until_infinity": "bütün günlerin sonu"
+            "header": "$1 şu anda engelli!"
         },
         "gblock": {
             "disabled": "Bu hesap şu anda devre dışı!",

+ 1 - 4
i18n/zh-hans.json

@@ -682,10 +682,7 @@
     },
     "user": {
         "block": {
-            "header": "$1 目前正被封禁!",
-            "noreason": "被 $3 封禁,时间从 $1 到 $2。",
-            "text": "被 $3 封禁,时间从 $1 到 $2,理由:“$4”。",
-            "until_infinity": "天荒地老"
+            "header": "$1 目前正被封禁!"
         },
         "gblock": {
             "disabled": "此账户目前正被禁用!",

+ 1 - 4
i18n/zh-hant.json

@@ -682,10 +682,7 @@
     },
     "user": {
         "block": {
-            "header": "$1 目前正被封鎖!",
-            "noreason": "被 $3 封鎖,時間從 $1 到 $2。",
-            "text": "被 $3 封鎖,時間從 $1 到 $2,理由:「$4」。",
-            "until_infinity": "天荒地老"
+            "header": "$1 目前正被封鎖!"
         },
         "gblock": {
             "disabled": "此賬戶目前正被禁用!",

+ 11 - 0
package-lock.json

@@ -9,6 +9,7 @@
       "license": "ISC",
       "dependencies": {
         "cheerio": "^1.0.0-rc.6",
+        "datetime-difference": "^1.0.2",
         "discord-oauth2": "^2.6.0",
         "discord.js": "^12.5.1",
         "dotenv": "^8.2.0",
@@ -217,6 +218,11 @@
         "node": ">= 6"
       }
     },
+    "node_modules/datetime-difference": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/datetime-difference/-/datetime-difference-1.0.2.tgz",
+      "integrity": "sha512-nQrIuV1WhKLD9VxfoXm6NbvScy3XbuoJ5Q+POKpLf3ZN9QYkIHpXzEJHK51a+ltrMQpyCkVzGrZmWbxjCjHMvQ=="
+    },
     "node_modules/decompress-response": {
       "version": "6.0.0",
       "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz",
@@ -3462,6 +3468,11 @@
       "resolved": "https://registry.npmjs.org/css-what/-/css-what-5.0.0.tgz",
       "integrity": "sha512-qxyKHQvgKwzwDWC/rGbT821eJalfupxYW2qbSJSAtdSTimsr/MlaGONoNLllaUPZWf8QnbcKM/kPVYUQuEKAFA=="
     },
+    "datetime-difference": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/datetime-difference/-/datetime-difference-1.0.2.tgz",
+      "integrity": "sha512-nQrIuV1WhKLD9VxfoXm6NbvScy3XbuoJ5Q+POKpLf3ZN9QYkIHpXzEJHK51a+ltrMQpyCkVzGrZmWbxjCjHMvQ=="
+    },
     "decompress-response": {
       "version": "6.0.0",
       "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz",

+ 1 - 0
package.json

@@ -16,6 +16,7 @@
   },
   "dependencies": {
     "cheerio": "^1.0.0-rc.6",
+    "datetime-difference": "^1.0.2",
     "discord-oauth2": "^2.6.0",
     "discord.js": "^12.5.1",
     "dotenv": "^8.2.0",