mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-18 21:40:49 +02:00
Fix
This commit is contained in:
@@ -205,7 +205,7 @@ module.exports = class CarRaceCommand extends Command {
|
|||||||
const winner = userCarSpaces > oppoCarSpaces ? msg.author : opponent;
|
const winner = userCarSpaces > oppoCarSpaces ? msg.author : opponent;
|
||||||
const winnerCar = winner.id === msg.author.id ? car : car2;
|
const winnerCar = winner.id === msg.author.id ? car : car2;
|
||||||
return msg.say(`Congrats, ${winner}!`, {
|
return msg.say(`Congrats, ${winner}!`, {
|
||||||
files: [path.join(__dirname, '..', '..', 'assets', 'json', 'car-race', 'cars', `${winnerCar}.png`)]
|
files: [path.join(__dirname, '..', '..', 'assets', 'images', 'car-race', 'cars', `${winnerCar}.png`)]
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.client.games.delete(msg.channel.id);
|
this.client.games.delete(msg.channel.id);
|
||||||
@@ -217,9 +217,9 @@ module.exports = class CarRaceCommand extends Command {
|
|||||||
const canvas = createCanvas(bg.width, bg.height);
|
const canvas = createCanvas(bg.width, bg.height);
|
||||||
const ctx = canvas.getContext('2d');
|
const ctx = canvas.getContext('2d');
|
||||||
ctx.drawImage(bg, 0, 0);
|
ctx.drawImage(bg, 0, 0);
|
||||||
const oppoCarX = -155 + (92 * oppoCarSpaces);
|
const oppoCarX = -155 + (46 * oppoCarSpaces);
|
||||||
ctx.drawImage(oppoCar, oppoCarX, 208);
|
ctx.drawImage(oppoCar, oppoCarX, 208);
|
||||||
const userCarX = -155 + (92 * userCarSpaces);
|
const userCarX = -155 + (46 * userCarSpaces);
|
||||||
ctx.drawImage(userCar, userCarX, 254);
|
ctx.drawImage(userCar, userCarX, 254);
|
||||||
return canvas.toBuffer();
|
return canvas.toBuffer();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user