mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-22 18:29:14 +02:00
Fix lint
This commit is contained in:
@@ -27,12 +27,12 @@ module.exports = class FontCommand extends Command {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async run(msg, { font, text }) {
|
run(msg, { font, text }) {
|
||||||
const image = await this.generateImage(font, text);
|
const image = this.generateImage(font, text);
|
||||||
return msg.say({ files: [{ attachment: image, name: `${font.filenameNoExt}.png` }] });
|
return msg.say({ files: [{ attachment: image, name: `${font.filenameNoExt}.png` }] });
|
||||||
}
|
}
|
||||||
|
|
||||||
async generateImage(font, text) {
|
generateImage(font, text) {
|
||||||
const canvasPre = createCanvas(1, 1);
|
const canvasPre = createCanvas(1, 1);
|
||||||
const ctxPre = canvasPre.getContext('2d');
|
const ctxPre = canvasPre.getContext('2d');
|
||||||
ctxPre.font = this.client.fonts.get(font.filename).toCanvasString(50);
|
ctxPre.font = this.client.fonts.get(font.filename).toCanvasString(50);
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ module.exports = class JeopardyQuestionCommand extends Command {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async run(msg, { text }) {
|
run(msg, { text }) {
|
||||||
const canvas = createCanvas(1280, 720);
|
const canvas = createCanvas(1280, 720);
|
||||||
const ctx = canvas.getContext('2d');
|
const ctx = canvas.getContext('2d');
|
||||||
ctx.fillStyle = '#030e78';
|
ctx.fillStyle = '#030e78';
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ module.exports = class JeopardyCommand extends Command {
|
|||||||
|
|
||||||
async run(msg) {
|
async run(msg) {
|
||||||
const question = await this.fetchQuestion();
|
const question = await this.fetchQuestion();
|
||||||
const clueCard = await this.generateClueCard(question.question.replace(/<\/?i>/gi, ''));
|
const clueCard = this.generateClueCard(question.question.replace(/<\/?i>/gi, ''));
|
||||||
const connection = msg.guild ? this.client.dispatchers.get(msg.guild.id) : null;
|
const connection = msg.guild ? this.client.dispatchers.get(msg.guild.id) : null;
|
||||||
let playing = false;
|
let playing = false;
|
||||||
if (msg.guild && connection && connection.canPlay) {
|
if (msg.guild && connection && connection.canPlay) {
|
||||||
@@ -70,7 +70,7 @@ module.exports = class JeopardyCommand extends Command {
|
|||||||
return body;
|
return body;
|
||||||
}
|
}
|
||||||
|
|
||||||
async generateClueCard(question) {
|
generateClueCard(question) {
|
||||||
const canvas = createCanvas(1280, 720);
|
const canvas = createCanvas(1280, 720);
|
||||||
const ctx = canvas.getContext('2d');
|
const ctx = canvas.getContext('2d');
|
||||||
ctx.fillStyle = '#030e78';
|
ctx.fillStyle = '#030e78';
|
||||||
|
|||||||
Reference in New Issue
Block a user