3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-07-08 03:27:20 +00:00

feat: new username support vol 2

This commit is contained in:
Dragory 2023-06-24 12:07:58 +00:00
parent ecaa16bf7c
commit 63c41f0278
29 changed files with 105 additions and 64 deletions

View file

@ -5,7 +5,7 @@ import { MAX_NICKNAME_ENTRIES_PER_USER } from "../../../data/GuildNicknameHistor
import { MAX_USERNAME_ENTRIES_PER_USER } from "../../../data/UsernameHistory";
import { NICKNAME_RETENTION_PERIOD } from "../../../data/cleanup/nicknames";
import { sendErrorMessage } from "../../../pluginUtils";
import { DAYS } from "../../../utils";
import { DAYS, renderUserUsername } from "../../../utils";
import { nameHistoryCmd } from "../types";
export const NamesCmd = nameHistoryCmd({
@ -31,7 +31,7 @@ export const NamesCmd = nameHistoryCmd({
const usernameRows = usernames.map((r) => `\`[${r.timestamp}]\` **${disableCodeBlocks(r.username)}**`);
const user = await pluginData.client.users.fetch(args.userId as Snowflake).catch(() => null);
const currentUsername = user ? user.tag : args.userId;
const currentUsername = user ? renderUserUsername(user) : args.userId;
const nicknameDays = Math.round(NICKNAME_RETENTION_PERIOD / DAYS);
const usernameDays = Math.round(NICKNAME_RETENTION_PERIOD / DAYS);