make the username selfcare use the player list

This commit is contained in:
Parker2991
2025-09-11 10:11:49 -05:00
parent c99d3ab302
commit d2e2124fbe
3 changed files with 17 additions and 25 deletions
+1 -1
View File
@@ -61,7 +61,7 @@ class player_list {
displayName: undefined,
vanished: false,
});
bot.emit('player_join', entry)
bot.emit('player_info', entry)
}
function initializeChat(entry) {}
+16
View File
@@ -0,0 +1,16 @@
class usernameSelfcare {
constructor(context) {
const bot = context.bot;
const options = context.options;
const config = context.config;
bot.on('player_info', (data) => {
if (data.uuid === bot.uuid) {
if (data.player.name !== bot.username) bot.selfcare.username = true;
else bot.selfcare.username = false
}
})
}
}
module.exports = usernameSelfcare;
-24
View File
@@ -1,24 +0,0 @@
class usernameSelfcare {
constructor(context) {
const bot = context.bot;
const options = context.options;
const stringMessage = context.stringMessage;
const config = context.config;
if (
stringMessage ===
`Successfully set your username to "${bot._client.username}"`
) {
bot.selfcare.username = false;
return;
} else if (stringMessage?.startsWith("Successfully set your username to "))
bot.selfcare.username = true;
else if (
stringMessage ===
`You already have the username "${bot._client.username}"`
)
bot.selfcare.username = false;
}
}
module.exports = usernameSelfcare;