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

removed unnecessary string literal and simplified stuff

This commit is contained in:
almeidx 2021-07-29 10:08:55 +01:00
parent d11f08ee8d
commit 9ffc91e5fa
17 changed files with 23 additions and 25 deletions

View file

@ -4,7 +4,7 @@ import { UsernameSaverPluginType } from "./types";
export async function updateUsername(pluginData: GuildPluginData<UsernameSaverPluginType>, user: User) {
if (!user) return;
const newUsername = `${user.tag}`;
const newUsername = user.tag;
const latestEntry = await pluginData.state.usernameHistory.getLastEntry(user.id);
if (!latestEntry || newUsername !== latestEntry.username) {
await pluginData.state.usernameHistory.addEntry(user.id, newUsername);