Use globalName

This commit is contained in:
lilyissillyyy
2025-09-18 16:11:31 -04:00
parent 4a8aa67a72
commit 46e7a9e244
21 changed files with 48 additions and 36 deletions
+3 -2
View File
@@ -29,13 +29,14 @@ module.exports = class ButtCommand extends Command {
run(msg, { user }) {
const authorUser = user.id === msg.author.id;
const displayName = user.globalName || user.username;
if (user.id === this.client.user.id) return msg.reply('Me? I think I have the best butt around!');
if (this.client.isOwner(user)) {
if (authorUser) return msg.reply('ur butt is the best, mother');
return msg.reply(`${user.username}'s butt is... Something, I'll say that much.`);
return msg.reply(`${displayName}'s butt is... Something, I'll say that much.`);
}
const random = MersenneTwister19937.seed(user.id);
const quality = integer(0, texts.length - 1)(random);
return msg.reply(`${authorUser ? 'ur' : `${user.username}'s`} butt is ${texts[quality]}`);
return msg.reply(`${authorUser ? 'ur' : `${displayName}'s`} butt is ${texts[quality]}`);
}
};
+4 -3
View File
@@ -22,14 +22,15 @@ module.exports = class CoolnessCommand extends Command {
run(msg, { user }) {
const authorUser = user.id === msg.author.id;
const displayName = user.globalName || user.username;
if (user.id === this.client.user.id) return msg.reply('Me? I think I\'m the very best, like no one ever was.');
if (this.client.isOwner(user)) {
if (authorUser) return msg.reply('You\'re the best owner a bot could ask for! ❤');
return msg.reply(`Don't tell her I said this but I think ${user.username} smells like a sack of diapers.`);
return msg.reply(`Don't tell her I said this but I think ${displayName} smells like a sack of diapers.`);
}
if (user.id === LOVER_USER_ID) return msg.reply(`${user.username} is by far the coolest person ever! ❤`);
if (user.id === LOVER_USER_ID) return msg.reply(`${displayName} is by far the coolest person ever! ❤`);
const random = MersenneTwister19937.seed(user.id);
const coolness = integer(0, texts.length - 1)(random);
return msg.reply(`${authorUser ? 'You are' : `${user.username} is`} ${texts[coolness]}`);
return msg.reply(`${authorUser ? 'You are' : `${displayName} is`} ${texts[coolness]}`);
}
};
+4 -3
View File
@@ -22,14 +22,15 @@ module.exports = class CutenessCommand extends Command {
run(msg, { user }) {
const authorUser = user.id === msg.author.id;
const displayName = user.globalName || user.username;
if (user.id === this.client.user.id) return msg.reply('Me? I think I\'m by far the cutest girl ever!');
if (this.client.isOwner(user)) {
if (authorUser) return msg.reply('You\'re the most adorable little cutie I know! ❤');
return msg.reply(`${user.username} is ugly. Like, not cute at all.`);
return msg.reply(`${displayName} is ugly. Like, not cute at all.`);
}
if (user.id === LOVER_USER_ID) return msg.reply(`${user.username} is by far the cutest person ever! ❤`);
if (user.id === LOVER_USER_ID) return msg.reply(`${displayName} is by far the cutest person ever! ❤`);
const random = MersenneTwister19937.seed(user.id);
const cuteness = integer(0, texts.length - 1)(random);
return msg.reply(`${authorUser ? 'You are' : `${user.username} is`} ${texts[cuteness]}`);
return msg.reply(`${authorUser ? 'You are' : `${displayName} is`} ${texts[cuteness]}`);
}
};
+2 -2
View File
@@ -81,8 +81,8 @@ module.exports = class FriendshipCommand extends Command {
ctx.font = this.client.fonts.get('Pinky Cupid.otf').toCanvasString(40);
ctx.fillText('~Xiao\'s Friendship Meter~', 600, 15);
ctx.fillStyle = 'white';
ctx.fillText(first.username, 270, 448);
ctx.fillText(second.username, 930, 448);
ctx.fillText(first.globalName || first.username, 270, 448);
ctx.fillText(second.globalName || second.username, 930, 448);
ctx.font = this.client.fonts.get('Pinky Cupid.otf').toCanvasString(60);
ctx.fillStyle = percentColor(level / 100, percentColors);
ctx.fillText(`~${level}%~`, 600, 230);
+4 -3
View File
@@ -24,13 +24,14 @@ module.exports = class GuessLooksCommand extends Command {
run(msg, { user }) {
if (user.id === this.client.user.id) return msg.reply('Me? Just look at my avatar, dummy.');
const displayName = user.globalName || user.username;
const authorUser = user.id === msg.author.id;
if (this.client.isOwner(user)) {
if (authorUser) return msg.reply('You look amazing as always, cutie! ❤');
return msg.reply(`${user.username} looks like a monkey, and smells like one too.`);
return msg.reply(`${displayName} looks like a monkey, and smells like one too.`);
}
if (user.id === LOVER_USER_ID) {
return msg.reply(`Know what perfection looks like? That's what ${user.username} looks like. ❤`);
return msg.reply(`Know what perfection looks like? That's what ${displayName} looks like. ❤`);
}
const random = MersenneTwister19937.seed(user.id);
const gender = genders[integer(0, genders.length - 1)(random)];
@@ -43,7 +44,7 @@ module.exports = class GuessLooksCommand extends Command {
const weight = integer(50, 300)(random);
const extra = extras[integer(0, extras.length - 1)(random)];
return msg.reply(oneLine`
I think ${authorUser ? 'you are' : `${user.username} is`} a ${age} year old ${gender} with ${eyeColor} eyes
I think ${authorUser ? 'you are' : `${displayName} is`} a ${age} year old ${gender} with ${eyeColor} eyes
and ${hairStyle} ${hairColor} hair. ${authorUser ? 'You are' : `${gender === 'man' ? 'He' : 'She'} is`}
${feet}'${inches}" and weigh${authorUser ? '' : 's'} ${weight} pounds. Don't forget the ${extra}!
`);
+3 -2
View File
@@ -20,13 +20,14 @@ module.exports = class IQCommand extends Command {
run(msg, { user }) {
const authorUser = user.id === msg.author.id;
const displayName = user.globalName || user.username;
if (user.id === this.client.user.id) return msg.reply('Me? My IQ score is off the charts!');
if (this.client.isOwner(user)) {
if (authorUser) return msg.reply('Only someone of the highest IQ could make a bot as amazing as me! ❤');
return msg.reply(`${user.username}, as in my owner? Yeah... Not the sharpest tool in the shed.`);
return msg.reply(`${displayName}, as in my owner? Yeah... Not the sharpest tool in the shed.`);
}
const random = MersenneTwister19937.seed(user.id);
const score = integer(20, 170)(random);
return msg.reply(`${authorUser ? 'Your' : `${user.username}'s`} IQ score is ${score}.`);
return msg.reply(`${authorUser ? 'Your' : `${displayName}'s`} IQ score is ${score}.`);
}
};
+2 -2
View File
@@ -23,7 +23,7 @@ module.exports = class NameRaterCommand extends Command {
key: 'name',
type: 'string',
max: 25,
default: msg => msg.author.username,
default: msg => msg.author.globalName || msg.author.username,
validate: async name => {
const matches = name.match(/^(?:<@!?)([0-9]+)>$/);
if (matches) {
@@ -48,7 +48,7 @@ module.exports = class NameRaterCommand extends Command {
}
run(msg, { name }) {
if (name instanceof User) name = name.username;
if (name instanceof User) name = name.globalName || name.username;
if (name.toLowerCase() === this.client.user.username.toLowerCase()) {
return msg.say(
`<:${NAME_RATER_EMOJI_NAME}:${NAME_RATER_EMOJI_ID}> Yes, ${name}! What a perfect name! I'm speechless!`
+2 -2
View File
@@ -84,8 +84,8 @@ module.exports = class ShipCommand extends Command {
ctx.font = this.client.fonts.get('Pinky Cupid.otf').toCanvasString(40);
ctx.fillText('~Xiao\'s Compatability Meter~', 600, 15);
ctx.fillStyle = 'white';
ctx.fillText(first.username, 270, 448);
ctx.fillText(second.username, 930, 448);
ctx.fillText(first.globalName || first.username, 270, 448);
ctx.fillText(second.globalName || second.username, 930, 448);
ctx.font = this.client.fonts.get('Pinky Cupid.otf').toCanvasString(60);
ctx.fillStyle = percentColor(level / 100, percentColors);
ctx.fillText(`~${level}%~`, 600, 230);
+2 -2
View File
@@ -78,8 +78,8 @@ module.exports = class ThinkOfCommand extends Command {
ctx.font = this.client.fonts.get('Pinky Cupid.otf').toCanvasString(40);
ctx.fillText('~Xiao\'s Thought Reader~', 600, 15);
ctx.fillStyle = 'white';
ctx.fillText(first.username, 270, 448);
ctx.fillText(second.username, 930, 448);
ctx.fillText(first.globalName || first.username, 270, 448);
ctx.fillText(second.globalName || first.username, 930, 448);
ctx.fillStyle = thought.color;
ctx.font = this.client.fonts.get('Pinky Cupid.otf').toCanvasString(40);
ctx.fillText('thinks they are', 600, 230);
+4 -3
View File
@@ -22,16 +22,17 @@ module.exports = class WorthCommand extends Command {
run(msg, { user }) {
const authorUser = user.id === msg.author.id;
const displayName = user.globalName || user.username;
if (user.id === this.client.user.id) return msg.reply('Me? I\'m worth $5/month. At least that\'s how much I cost.');
if (this.client.isOwner(user)) {
if (authorUser) return msg.reply('Infinity, you amazing owner! ❤');
return msg.reply(`${user.username}, as in my owner? Worthless. Absolutely worthless.`);
return msg.reply(`${displayName}, as in my owner? Worthless. Absolutely worthless.`);
}
if (user.id === LOVER_USER_ID) {
return msg.reply(`${user.username} is worth more than anyone else on this Earth! ❤`);
return msg.reply(`${displayName} is worth more than anyone else on this Earth! ❤`);
}
const random = MersenneTwister19937.seed(user.id);
const worth = integer(0, 1000000)(random);
return msg.reply(`${authorUser ? 'You are' : `${user.username} is`} worth $${formatNumber(worth)}.`);
return msg.reply(`${authorUser ? 'You are' : `${displayName} is`} worth $${formatNumber(worth)}.`);
}
};