mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Ship and Friendship Owner Replies
This commit is contained in:
@@ -39,7 +39,7 @@
|
||||
"The `dick` command, when used on Xiao, will give your own size, plus one.",
|
||||
"There are several special timezones in `time`, such as \"Discord\", \"Dragon\", and \"Neopia\".",
|
||||
"The `bro-hoof` and `high-five` commands used to be the same, but users complained about the MLP GIFs, causing them to be split.",
|
||||
"Xiao used to have several more roleplay commands, such as `cuddle`, `marry`, `divorce`, `falcon-punch`, and `inhale`. These were merged with other commands due to lack of good GIFs.",
|
||||
"Xiao used to have several more roleplay commands, such as `cuddle`, `marry`, `divorce`, and `falcon-punch`. These were merged with other commands due to lack of good GIFs.",
|
||||
"The `anime` and `manga` commands have used MyAnimeList, Kitsu, and Anilist over their development. The current use of Anilist is due to Dragon Fire's status as a data mod there.",
|
||||
"The `company` command has Dragon Fire's logo inserted into it manually, Clearbit does not actually acknowledge us.",
|
||||
"Xiao used to have `gelbooru` and `konachan` commands, but due to their similarity to `danbooru`, they were removed.",
|
||||
@@ -52,5 +52,6 @@
|
||||
"Xiao began development in February 2017, and was most likely active sometime in 2016 under a different name.",
|
||||
"The command with the most lines of code is, oddly enough, `anime`, at 189.",
|
||||
"The `ship` command gives a special response if the compatability is 69.",
|
||||
"The `jeopardy` command will play the Jeopardy think music if both you and the bot are in a voice channel when the command is used."
|
||||
"The `jeopardy` command will play the Jeopardy think music if both you and the bot are in a voice channel when the command is used.",
|
||||
"Dragon Fire, the developer of Xiao, is forever alone."
|
||||
]
|
||||
|
||||
@@ -52,7 +52,15 @@ 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.');
|
||||
const calculated = -Math.abs(Number.parseInt(BigInt(first.id) - BigInt(second.id), 10));
|
||||
let calculated;
|
||||
const owner = this.client.isOwner(first) || this.client.isOwner(second);
|
||||
const authorUser = first.id === msg.author.id || second.id === msg.author.id;
|
||||
if (owner) {
|
||||
if (authorUser) calculated = 100;
|
||||
else calculated = 0;
|
||||
} else {
|
||||
calculated = -Math.abs(Number.parseInt(BigInt(first.id) - BigInt(second.id), 10));
|
||||
}
|
||||
const random = MersenneTwister19937.seed(calculated);
|
||||
const level = integer(0, 100)(random);
|
||||
const firstAvatarURL = first.displayAvatarURL({ format: 'png', size: 512 });
|
||||
@@ -79,7 +87,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), 600, 296);
|
||||
ctx.fillText(this.calculateLevelText(level, owner, authorUser), 600, 296);
|
||||
ctx.font = '90px Pinky Cupid';
|
||||
ctx.fillText(level > 49 ? '👍' : '👎', 600, 100);
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'friendship.png' }] });
|
||||
@@ -88,7 +96,11 @@ module.exports = class FriendshipCommand extends Command {
|
||||
}
|
||||
}
|
||||
|
||||
calculateLevelText(level) {
|
||||
calculateLevelText(level, owner, authorUser) {
|
||||
if (owner) {
|
||||
if (authorUser) return 'Perfect';
|
||||
else return 'Yuck';
|
||||
}
|
||||
if (level === 0) return 'Abysmal';
|
||||
if (level > 0 && level < 10) return 'Horrid';
|
||||
if (level > 9 && level < 20) return 'Awful';
|
||||
|
||||
@@ -52,7 +52,14 @@ 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.');
|
||||
const calculated = Math.abs(Number.parseInt(BigInt(first.id) - BigInt(second.id), 10));
|
||||
let calculated;
|
||||
const owner = this.client.isOwner(first) || this.client.isOwner(second);
|
||||
const authorUser = first.id === msg.author.id || second.id === msg.author.id;
|
||||
if (owner) {
|
||||
calculated = 0;
|
||||
} else {
|
||||
calculated = Math.abs(Number.parseInt(BigInt(first.id) - BigInt(second.id), 10));
|
||||
}
|
||||
const random = MersenneTwister19937.seed(calculated);
|
||||
const level = integer(0, 100)(random);
|
||||
const firstAvatarURL = first.displayAvatarURL({ format: 'png', size: 512 });
|
||||
@@ -79,7 +86,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), 600, 296);
|
||||
ctx.fillText(this.calculateLevelText(level, owner, authorUser), 600, 296);
|
||||
ctx.font = '90px Pinky Cupid';
|
||||
ctx.fillText(level > 49 ? '❤️' : '💔', 600, 100);
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'ship.png' }] });
|
||||
@@ -88,7 +95,11 @@ module.exports = class ShipCommand extends Command {
|
||||
}
|
||||
}
|
||||
|
||||
calculateLevelText(level) {
|
||||
calculateLevelText(level, owner, authorUser) {
|
||||
if (owner) {
|
||||
if (authorUser) return 'Pervert';
|
||||
else return 'Yuck';
|
||||
}
|
||||
if (level === 0) return 'Abysmal';
|
||||
if (level > 0 && level < 10) return 'Horrid';
|
||||
if (level > 9 && level < 20) return 'Awful';
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "114.31.2",
|
||||
"version": "114.31.3",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user