From ff231d1f6ee54e6df9a2192e170ef68e7eaca294 Mon Sep 17 00:00:00 2001 From: toast-ts <96593068+toast-ts@users.noreply.github.com> Date: Tue, 1 Aug 2023 19:24:24 +1000 Subject: [PATCH] Support for Discord's new username system --- src/models/userLevels.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models/userLevels.ts b/src/models/userLevels.ts index d4e2ba2..61cfa38 100644 --- a/src/models/userLevels.ts +++ b/src/models/userLevels.ts @@ -29,7 +29,7 @@ export default class userLevels extends Schema { } else if (userData.messages >= this.algorithm(userData.level+1)) { const newData = await this._content.findByIdAndUpdate(userid, {level:userData.level+1}, {new: true}); 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}) }