diff --git a/commands/random-seed/friendship.js b/commands/random-seed/friendship.js index 721814d4..69512af4 100644 --- a/commands/random-seed/friendship.js +++ b/commands/random-seed/friendship.js @@ -51,14 +51,16 @@ module.exports = class FriendshipCommand extends Command { } async run(msg, { first, second }) { - if (first.id === second.id) return msg.reply('You should be good friends with yourself.'); let level; + const self = first.id === second.id; const owner = this.client.isOwner(first) || this.client.isOwner(second); const authorUser = first.id === msg.author.id || second.id === msg.author.id; const botUser = first.id === this.client.user.id || second.id === this.client.user.id; if (owner && botUser) { if (authorUser) level = 100; else level = 0; + } else if (self) { + level = 100; } else { const calculated = -Math.abs(Number.parseInt(BigInt(first.id) - BigInt(second.id), 10)); const random = MersenneTwister19937.seed(calculated); @@ -88,7 +90,7 @@ module.exports = class FriendshipCommand extends Command { ctx.font = '60px Pinky Cupid'; ctx.fillStyle = percentColor(level / 100, percentColors); ctx.fillText(`~${level}%~`, 600, 230); - ctx.fillText(this.calculateLevelText(level, owner, authorUser, botUser), 600, 296); + ctx.fillText(this.calculateLevelText(level, self, owner, authorUser, botUser), 600, 296); ctx.font = '90px Pinky Cupid'; ctx.fillText(level > 49 ? '👍' : '👎', 600, 100); return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'friendship.png' }] }); @@ -97,11 +99,12 @@ module.exports = class FriendshipCommand extends Command { } } - calculateLevelText(level, owner, authorUser, botUser) { + calculateLevelText(level, self, owner, authorUser, botUser) { if (owner && botUser) { if (authorUser) return 'Perfect'; else return 'Yuck'; } + if (self) return 'Narcissist'; if (level === 0) return 'Abysmal'; if (level > 0 && level < 10) return 'Horrid'; if (level > 9 && level < 20) return 'Awful'; diff --git a/commands/random-seed/ship.js b/commands/random-seed/ship.js index 7cdf6c07..a39cc252 100644 --- a/commands/random-seed/ship.js +++ b/commands/random-seed/ship.js @@ -51,13 +51,15 @@ module.exports = class ShipCommand extends Command { } async run(msg, { first, second }) { - if (first.id === second.id) return msg.reply('Shipping someone with themselves would be pretty weird.'); let level; + const self = first.id === second.id; const owner = this.client.isOwner(first) || this.client.isOwner(second); const authorUser = first.id === msg.author.id || second.id === msg.author.id; const botUser = first.id === this.client.user.id || second.id === this.client.user.id; if (owner && botUser) { level = 0; + } else if (self) { + level = 100; } else { const calculated = Math.abs(Number.parseInt(BigInt(first.id) - BigInt(second.id), 10)); const random = MersenneTwister19937.seed(calculated); @@ -87,7 +89,7 @@ module.exports = class ShipCommand extends Command { ctx.font = '60px Pinky Cupid'; ctx.fillStyle = percentColor(level / 100, percentColors); ctx.fillText(`~${level}%~`, 600, 230); - ctx.fillText(this.calculateLevelText(level, owner, authorUser, botUser), 600, 296); + ctx.fillText(this.calculateLevelText(level, self, owner, authorUser, botUser), 600, 296); ctx.font = '90px Pinky Cupid'; ctx.fillText(level > 49 ? '❤️' : '💔', 600, 100); return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'ship.png' }] }); @@ -96,11 +98,12 @@ module.exports = class ShipCommand extends Command { } } - calculateLevelText(level, owner, authorUser, botUser) { + calculateLevelText(level, self, owner, authorUser, botUser) { if (owner && botUser) { if (authorUser) return 'Pervert'; else return 'Yuck'; } + if (self) return 'Narcissist'; if (level === 0) return 'Abysmal'; if (level > 0 && level < 10) return 'Horrid'; if (level > 9 && level < 20) return 'Awful'; diff --git a/package.json b/package.json index 98cac466..a20003db 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "116.1.3", + "version": "116.1.4", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {