diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-02-03 21:12:19 -0500 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-02-03 21:12:19 -0500 |
commit | 821ed93ccf55e4f32f6f25f502bce1e5b161d356 (patch) | |
tree | 42d0547f589134a6e549975f2da199f943e7b3b9 /src/lib | |
parent | 75eb731d077638472abc2f2423f6759a110bcda6 (diff) | |
download | tanzanite-821ed93ccf55e4f32f6f25f502bce1e5b161d356.tar.gz tanzanite-821ed93ccf55e4f32f6f25f502bce1e5b161d356.tar.bz2 tanzanite-821ed93ccf55e4f32f6f25f502bce1e5b161d356.zip |
add bot info to user info command
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/common/AutoMod.ts | 4 | ||||
-rw-r--r-- | src/lib/extensions/discord-akairo/BushClientUtil.ts | 24 | ||||
-rw-r--r-- | src/lib/utils/BushConstants.ts | 16 |
3 files changed, 26 insertions, 18 deletions
diff --git a/src/lib/common/AutoMod.ts b/src/lib/common/AutoMod.ts index 24feae0..2633e1a 100644 --- a/src/lib/common/AutoMod.ts +++ b/src/lib/common/AutoMod.ts @@ -145,7 +145,7 @@ export class AutoMod { new Embed() .setTitle(`[Severity ${Severity.TEMP_MUTE}] Mention Scam Deleted`) .setDescription( - `**User:** ${this.message.author} (${this.message.author.tag})\n**Sent From**: <#${this.message.channel.id}> [Jump to context](${this.message.url})` + `**User:** ${this.message.author} (${this.message.author.tag})\n**Sent From:** <#${this.message.channel.id}> [Jump to context](${this.message.url})` ) .addField({ name: 'Message Content', value: `${await util.codeblock(this.message.content, 1024)}` }) .setColor(color) @@ -263,7 +263,7 @@ export class AutoMod { new Embed() .setTitle(`[Severity ${highestOffence.severity}] Automod Action Performed`) .setDescription( - `**User:** ${this.message.author} (${this.message.author.tag})\n**Sent From**: <#${ + `**User:** ${this.message.author} (${this.message.author.tag})\n**Sent From:** <#${ this.message.channel.id }> [Jump to context](${this.message.url})\n**Blacklisted Words:** ${offences.map((o) => `\`${o.match}\``).join(', ')}` ) diff --git a/src/lib/extensions/discord-akairo/BushClientUtil.ts b/src/lib/extensions/discord-akairo/BushClientUtil.ts index 09dd84d..7026539 100644 --- a/src/lib/extensions/discord-akairo/BushClientUtil.ts +++ b/src/lib/extensions/discord-akairo/BushClientUtil.ts @@ -195,6 +195,9 @@ export class BushClientUtil extends ClientUtil { return client.consts.emojis; } + /** + * Just the ids of Commonly Used Emojis + */ get emojisRaw() { return client.consts.emojisRaw; } @@ -251,7 +254,7 @@ export class BushClientUtil extends ClientUtil { * @returns The inspected object. */ public inspect(object: any, options?: BushInspectOptions): string { - const optionsWithDefaults = this.getDefaultInspectOptions(options); + const optionsWithDefaults = this.#getDefaultInspectOptions(options); return inspect(object, optionsWithDefaults); } @@ -260,7 +263,7 @@ export class BushClientUtil extends ClientUtil { * @param options The options to create defaults with. * @returns The default options combined with the specified options. */ - private getDefaultInspectOptions(options?: BushInspectOptions): BushInspectOptions { + #getDefaultInspectOptions(options?: BushInspectOptions): BushInspectOptions { const { showHidden = false, depth = 2, @@ -582,13 +585,13 @@ export class BushClientUtil extends ClientUtil { * * @see * **Styles:** - * - **t**: Short Time - * - **T**: Long Time - * - **d**: Short Date - * - **D**: Long Date - * - **f**: Short Date/Time - * - **F**: Long Date/Time - * - **R**: Relative Time + * - **t**: Short Time ex. `16:20` + * - **T**: Long Time ex. `16:20:30 ` + * - **d**: Short Date ex. `20/04/2021` + * - **D**: Long Date ex. `20 April 2021` + * - **f**: Short Date/Time ex. `20 April 2021 16:20` + * - **F**: Long Date/Time ex. `Tuesday, 20 April 2021 16:20` + * - **R**: Relative Time ex. `2 months ago` */ public timestamp<D extends Date | undefined | null>( date: D, @@ -696,8 +699,7 @@ export class BushClientUtil extends ClientUtil { * @returns A string with each method on a new line. */ public getMethods(obj: Record<string, any>): string { - // modified from https://stackoverflow.com/questions/31054910/get-functions-methods-of-a-class - // answer by Bruno Grieder + // modified from https://stackoverflow.com/questions/31054910/get-functions-methods-of-a-class/31055217#31055217 let props: string[] = []; let obj_: Record<string, any> = new Object(obj); diff --git a/src/lib/utils/BushConstants.ts b/src/lib/utils/BushConstants.ts index 4012054..5b2b2e6 100644 --- a/src/lib/utils/BushConstants.ts +++ b/src/lib/utils/BushConstants.ts @@ -148,13 +148,17 @@ export class BushConstants { public static regex = BushClientUtil.deepFreeze({ snowflake: /^\d{15,21}$/im, + discordEmoji: /<a?:(?<name>[a-zA-Z0-9_]+):(?<id>\d{15,21})>/im, //stolen from geek messageLink: - /(?:ptb\.|canary\.|staging\.|lc\.)?(?:discord(?:app)?|inv)\.(?:com|wtf)?\/channels\/(?<guild_id>\d{15,21}|@me)\/(?<channel_id>\d{15,21})\/(?<message_id>\d{15,21})/im + /(?:ptb\.|canary\.|staging\.|lc\.)?(?:discord(?:app)?)\.(?:com)?\/channels\/(?<guild_id>\d{15,21}|@me)\/(?<channel_id>\d{15,21})\/(?<message_id>\d{15,21})/im } as const); + /** + * Maps the response from pronoundb.org to a readable format + */ public static pronounMapping = Object.freeze({ unspecified: 'Unspecified', hh: 'He/Him', @@ -179,7 +183,9 @@ export class BushConstants { avoid: 'Avoid pronouns, use my name' } as const); - /** A bunch of mappings */ + /** + * A bunch of mappings + */ public static mappings = BushClientUtil.deepFreeze({ guilds: { bush: '516977525906341928', @@ -320,12 +326,12 @@ export class BushConstants { HypeSquadOnlineHouse2: '<:hypeSquadBrilliance:848742840649646101>', HypeSquadOnlineHouse3: '<:hypeSquadBalance:848742877537370133>', PremiumEarlySupporter: '<:earlySupporter:848741030102171648>', - TeamPseudoUser: 'TEAM_PSEUDO_USER', + TeamPseudoUser: 'TeamPseudoUser', BugHunterLevel2: '<:bugHunterGold:848743283080822794>', - VerifiedBot: 'VERIFIED_BOT', + VerifiedBot: '<:verifiedbot_rebrand1:938928232667947028><:verifiedbot_rebrand2:938928355707879475>', VerifiedDeveloper: '<:earlyVerifiedBotDeveloper:848741079875846174>', CertifiedModerator: '<:discordCertifiedModerator:877224285901582366>', - BotHTTPInteractions: 'BOT_HTTP_INTERACTIONS' + BotHTTPInteractions: 'BotHTTPInteractions' }, status: { |