mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-22 18:29:14 +02:00
More natural like/retweet/reply count in tweet
This commit is contained in:
@@ -68,11 +68,11 @@ module.exports = class TweetCommand extends Command {
|
|||||||
const ctx = canvas.getContext('2d');
|
const ctx = canvas.getContext('2d');
|
||||||
ctx.font = '23px Noto';
|
ctx.font = '23px Noto';
|
||||||
const lines = await wrapText(ctx, text, 710);
|
const lines = await wrapText(ctx, text, 710);
|
||||||
const linesLen = (23 * lines.length) + (8 * (lines.length - 1));
|
const linesLen = (23 * lines.length) + (9 * (lines.length - 1));
|
||||||
canvas.height += linesLen;
|
canvas.height += linesLen;
|
||||||
const likes = Math.floor(Math.random() * 999999) + 1;
|
const likes = Math.floor(Math.random() * 100000) + 1;
|
||||||
const retweets = Math.floor(Math.random() * 999999) + 1;
|
const retweets = Math.floor(Math.random() * 100000) + 1;
|
||||||
const replies = Math.floor(Math.random() * 999999) + 1;
|
const replies = Math.floor(Math.random() * 100000) + 1;
|
||||||
ctx.fillStyle = '#15202b';
|
ctx.fillStyle = '#15202b';
|
||||||
ctx.fillRect(0, base1.height, canvas.width, linesLen);
|
ctx.fillRect(0, base1.height, canvas.width, linesLen);
|
||||||
ctx.drawImage(base1, 0, 0);
|
ctx.drawImage(base1, 0, 0);
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "114.30.3",
|
"version": "114.30.4",
|
||||||
"description": "Your personal server companion.",
|
"description": "Your personal server companion.",
|
||||||
"main": "Xiao.js",
|
"main": "Xiao.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user