mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
Actual fix for said crash
This commit is contained in:
parent
a4919523c1
commit
13a38a2f64
1 changed files with 1 additions and 2 deletions
|
@ -12,10 +12,9 @@ export class UsernameSaver extends GlobalPlugin {
|
|||
}
|
||||
|
||||
protected async updateUsername(user: User) {
|
||||
if (!user) return;
|
||||
const newUsername = `${user.username}#${user.discriminator}`;
|
||||
const latestEntry = await this.usernameHistory.getLastEntry(user.id);
|
||||
if (newUsername !== latestEntry.username) {
|
||||
if (!latestEntry || newUsername !== latestEntry.username) {
|
||||
await this.usernameHistory.addEntry(user.id, newUsername);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue