mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 15:07:42 +02:00
Fix
This commit is contained in:
@@ -90,7 +90,7 @@ module.exports = class TweetCommand extends Command {
|
||||
path.join(__dirname, '..', '..', 'assets', 'images', 'tweet', 'verified.png')
|
||||
);
|
||||
const nameLen = ctx.measureText(userData.name).width;
|
||||
ctx.drawImage(verified, 80 + nameLen + 3, 86, 22, 22);
|
||||
ctx.drawImage(verified, 80 + nameLen + 3, 90, 20, 20);
|
||||
}
|
||||
ctx.font = this.client.fonts.get('Noto-Regular.ttf').toCanvasString(17);
|
||||
ctx.fillStyle = '#71767b';
|
||||
@@ -116,42 +116,42 @@ module.exports = class TweetCommand extends Command {
|
||||
let currentLen = 17;
|
||||
ctx.fillStyle = 'white';
|
||||
ctx.font = this.client.fonts.get('Noto-Bold.ttf').toCanvasString(18);
|
||||
ctx.fillText(formatNumberK(retweets), currentLen, base2StartY + 72);
|
||||
ctx.fillText(formatNumberK(retweets), currentLen, base2StartY + 67);
|
||||
currentLen += ctx.measureText(formatNumberK(retweets)).width;
|
||||
currentLen += 5;
|
||||
ctx.fillStyle = '#71767b';
|
||||
ctx.font = this.client.fonts.get('Noto-Regular.ttf').toCanvasString(18);
|
||||
ctx.fillText('Reposts', currentLen, base2StartY + 72);
|
||||
ctx.fillText('Reposts', currentLen, base2StartY + 67);
|
||||
currentLen += ctx.measureText('Reposts').width;
|
||||
currentLen += 10;
|
||||
ctx.fillStyle = 'white';
|
||||
ctx.font = this.client.fonts.get('Noto-Bold.ttf').toCanvasString(18);
|
||||
ctx.fillText(formatNumberK(quotTweets), currentLen, base2StartY + 72);
|
||||
ctx.fillText(formatNumberK(quotTweets), currentLen, base2StartY + 67);
|
||||
currentLen += ctx.measureText(formatNumberK(quotTweets)).width;
|
||||
currentLen += 5;
|
||||
ctx.fillStyle = '#71767b';
|
||||
ctx.font = this.client.fonts.get('Noto-Regular.ttf').toCanvasString(18);
|
||||
ctx.fillText('Quotes', currentLen, base2StartY + 72);
|
||||
ctx.fillText('Quotes', currentLen, base2StartY + 67);
|
||||
currentLen += ctx.measureText('Quotes').width;
|
||||
currentLen += 10;
|
||||
ctx.fillStyle = 'white';
|
||||
ctx.font = this.client.fonts.get('Noto-Bold.ttf').toCanvasString(18);
|
||||
ctx.fillText(formatNumberK(likes), currentLen, base2StartY + 72);
|
||||
ctx.fillText(formatNumberK(likes), currentLen, base2StartY + 67);
|
||||
currentLen += ctx.measureText(formatNumberK(likes)).width;
|
||||
currentLen += 5;
|
||||
ctx.fillStyle = '#71767b';
|
||||
ctx.font = this.client.fonts.get('Noto-Regular.ttf').toCanvasString(18);
|
||||
ctx.fillText('Likes', currentLen, base2StartY + 72);
|
||||
ctx.fillText('Likes', currentLen, base2StartY + 67);
|
||||
currentLen += ctx.measureText('Likes').width;
|
||||
currentLen += 10;
|
||||
ctx.fillStyle = 'white';
|
||||
ctx.font = this.client.fonts.get('Noto-Bold.ttf').toCanvasString(18);
|
||||
ctx.fillText(formatNumberK(bookmarks), currentLen, base2StartY + 72);
|
||||
ctx.fillText(formatNumberK(bookmarks), currentLen, base2StartY + 67);
|
||||
currentLen += ctx.measureText(formatNumberK(bookmarks)).width;
|
||||
currentLen += 5;
|
||||
ctx.fillStyle = '#71767b';
|
||||
ctx.font = this.client.fonts.get('Noto-Regular.ttf').toCanvasString(18);
|
||||
ctx.fillText('Bookmarks', currentLen, base2StartY + 72);
|
||||
ctx.fillText('Bookmarks', currentLen, base2StartY + 67);
|
||||
ctx.beginPath();
|
||||
ctx.arc(17 + 26, 84 + 26, 26, 0, Math.PI * 2);
|
||||
ctx.closePath();
|
||||
|
||||
+3
-3
@@ -100,9 +100,9 @@ module.exports = class Util {
|
||||
}
|
||||
|
||||
static formatNumberK(number) {
|
||||
if (number > 999999999) `${(number / 1000000000).toLocaleString(undefined, { maximumFractionDigits: 1 })}B`;
|
||||
if (number > 999999) `${(number / 1000000).toLocaleString(undefined, { maximumFractionDigits: 1 })}M`;
|
||||
if (number > 999) return `${(number / 1000).toLocaleString(undefined, { maximumFractionDigits: 1 })}K`;
|
||||
if (number > 999999999) return `${Math.floor(number / 1000000000)}B`;
|
||||
if (number > 999999) return `${Math.floor(number / 1000000)}M`;
|
||||
if (number > 999) return `${Math.floor(number / 1000)}K`;
|
||||
return number;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user