3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

Don't save empty nicknames to nickname history if there's no previous entry

This commit is contained in:
Dragory 2020-06-02 01:36:42 +03:00
parent a3f697ad6e
commit e684bf7dac
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -84,6 +84,7 @@ export class NameHistoryPlugin extends ZeppelinPlugin<TConfigSchema> {
if (!member) return;
const latestEntry = await this.nicknameHistory.getLastEntry(member.id);
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);
}
}