mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-16 22:21:51 +00:00
Don't save empty nicknames to nickname history if there's no previous entry
This commit is contained in:
parent
a3f697ad6e
commit
e684bf7dac
1 changed files with 1 additions and 0 deletions
|
@ -84,6 +84,7 @@ export class NameHistoryPlugin extends ZeppelinPlugin<TConfigSchema> {
|
||||||
if (!member) return;
|
if (!member) return;
|
||||||
const latestEntry = await this.nicknameHistory.getLastEntry(member.id);
|
const latestEntry = await this.nicknameHistory.getLastEntry(member.id);
|
||||||
if (!latestEntry || latestEntry.nickname !== member.nick) {
|
if (!latestEntry || latestEntry.nickname !== member.nick) {
|
||||||
|
if (!latestEntry && member.nick == null) return; // No need to save "no nickname" if there's no previous data
|
||||||
await this.nicknameHistory.addEntry(member.id, member.nick);
|
await this.nicknameHistory.addEntry(member.id, member.nick);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue