Merge pull request #3 from almeidx/smol-refactor

Smol refactor
This commit is contained in:
Nils 2021-07-29 03:03:38 +02:00 committed by GitHub
commit 392e7fc56e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
66 changed files with 142 additions and 212 deletions

View file

@ -1099,6 +1099,7 @@ export class UnknownUser {
public id: string;
public username = "Unknown";
public discriminator = "0000";
public tag = "Unknown#0000";
constructor(props = {}) {
for (const key in props) {
@ -1353,18 +1354,18 @@ export function messageSummary(msg: SavedMessage) {
export function verboseUserMention(user: User | UnknownUser): string {
if (user.id == null) {
return `**${user.username}#${user.discriminator}**`;
return `**${user.tag}**`;
}
return `<@!${user.id}> (**${user.username}#${user.discriminator}**, \`${user.id}\`)`;
return `<@!${user.id}> (**${user.tag}**, \`${user.id}\`)`;
}
export function verboseUserName(user: User | UnknownUser): string {
if (user.id == null) {
return `**${user.username}#${user.discriminator}**`;
return `**${user.tag}**`;
}
return `**${user.username}#${user.discriminator}** (\`${user.id}\`)`;
return `**${user.tag}** (\`${user.id}\`)`;
}
export function verboseChannelMention(channel: GuildChannel): string {