mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-11-17 12:21:00 -05:00
Support for Discord's new username system
This commit is contained in:
parent
71dd0681e5
commit
6af7f3694d
@ -29,7 +29,7 @@ export default class userLevels extends Schema {
|
|||||||
} else if (userData.messages >= this.algorithm(userData.level+1)) {
|
} else if (userData.messages >= this.algorithm(userData.level+1)) {
|
||||||
const newData = await this._content.findByIdAndUpdate(userid, {level:userData.level+1}, {new: true});
|
const newData = await this._content.findByIdAndUpdate(userid, {level:userData.level+1}, {new: true});
|
||||||
const fetchUserSchema = await this._content.findById(userid);
|
const fetchUserSchema = await this._content.findById(userid);
|
||||||
(this.client.channels.resolve(this.client.config.mainServer.channels.botcommands) as Discord.TextChannel).send({content: `${fetchUserSchema.notificationPing === true ? `<@${userid}>` : `**${(await this.client.users.fetch(userid)).username}**`} has reached level **${newData.level}**. GG!`, allowedMentions: {parse: ['users']}});
|
(this.client.channels.resolve(this.client.config.mainServer.channels.botcommands) as Discord.TextChannel).send({content: `${fetchUserSchema.notificationPing === true ? `<@${userid}>` : `**${(await this.client.users.fetch(userid)).displayName}**`} has reached level **${newData.level}**. GG!`, allowedMentions: {parse: ['users']}});
|
||||||
}
|
}
|
||||||
} else await this._content.create({_id: userid, notificationPing: true, messages: 1, level: 0})
|
} else await this._content.create({_id: userid, notificationPing: true, messages: 1, level: 0})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user