mirror of
https://code.chipmunk.land/Parker2991/NitoriBot/
synced 2026-11-29 13:45:38 -05:00
make the username selfcare use the player list
This commit is contained in:
@@ -61,7 +61,7 @@ class player_list {
|
||||
displayName: undefined,
|
||||
vanished: false,
|
||||
});
|
||||
bot.emit('player_join', entry)
|
||||
bot.emit('player_info', entry)
|
||||
}
|
||||
|
||||
function initializeChat(entry) {}
|
||||
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
Reference in New Issue
Block a user