mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-17 16:19:12 +02:00
Fix
This commit is contained in:
@@ -3,7 +3,7 @@ const { createCanvas, loadImage } = require('canvas');
|
|||||||
const moment = require('moment');
|
const moment = require('moment');
|
||||||
const request = require('node-superfetch');
|
const request = require('node-superfetch');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const { base64, formatNumberK } = require('../../util/Util');
|
const { base64, formatNumberK, randomRange } = require('../../util/Util');
|
||||||
const { wrapText } = require('../../util/Canvas');
|
const { wrapText } = require('../../util/Canvas');
|
||||||
const { TWITTER_KEY, TWITTER_SECRET } = process.env;
|
const { TWITTER_KEY, TWITTER_SECRET } = process.env;
|
||||||
|
|
||||||
@@ -70,10 +70,10 @@ module.exports = class TweetCommand extends Command {
|
|||||||
+ (9 * (lines.length - 1))
|
+ (9 * (lines.length - 1))
|
||||||
+ (9 * (lineBreakLen - 1));
|
+ (9 * (lineBreakLen - 1));
|
||||||
canvas.height += linesLen;
|
canvas.height += linesLen;
|
||||||
const likes = Math.floor(Math.random() * Math.ceil(userData.followers * 0.02)) + 1;
|
const likes = randomRange(Math.ceil(userData.followers * 0.015), Math.ceil(userData.followers * 0.02));
|
||||||
const retweets = Math.floor(Math.random() * Math.ceil(userData.followers * 0.002)) + 1;
|
const retweets = randomRange(Math.ceil(userData.followers * 0.0015), Math.ceil(userData.followers * 0.002));
|
||||||
const quoteTweets = Math.floor(Math.random() * Math.ceil(userData.followers * 0.0002)) + 1;
|
const quoteTweets = randomRange(Math.ceil(userData.followers * 0.00015), Math.ceil(userData.followers * 0.0002));
|
||||||
const replies = Math.floor(Math.random() * Math.ceil(userData.followers * 0.0002)) + 1;
|
const replies = randomRange(Math.ceil(userData.followers * 0.00015), Math.ceil(userData.followers * 0.0002));
|
||||||
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);
|
||||||
|
|||||||
Reference in New Issue
Block a user