diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-09-05 20:24:50 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-09-05 20:24:50 -0400 |
commit | c4c1d9ffeb179e208792c88dd099caea5030581b (patch) | |
tree | dc075bda115de5f6cec925c398f3c9547d1bad55 /src/lib/extensions/discord-akairo/BushClientUtil.ts | |
parent | c238b0279c7686ca45506b0909e376f241cf0e30 (diff) | |
download | tanzanite-c4c1d9ffeb179e208792c88dd099caea5030581b.tar.gz tanzanite-c4c1d9ffeb179e208792c88dd099caea5030581b.tar.bz2 tanzanite-c4c1d9ffeb179e208792c88dd099caea5030581b.zip |
add moderation logging, fixes, hide modlog, jank
Diffstat (limited to 'src/lib/extensions/discord-akairo/BushClientUtil.ts')
-rw-r--r-- | src/lib/extensions/discord-akairo/BushClientUtil.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/extensions/discord-akairo/BushClientUtil.ts b/src/lib/extensions/discord-akairo/BushClientUtil.ts index 3f9e0b6..fec0174 100644 --- a/src/lib/extensions/discord-akairo/BushClientUtil.ts +++ b/src/lib/extensions/discord-akairo/BushClientUtil.ts @@ -8,6 +8,7 @@ import { BushGuildResolvable, BushMessage, BushSlashMessage, + BushUser, Global, Guild, ModLog, @@ -576,7 +577,7 @@ export class BushClientUtil extends ClientUtil { if (content.length > 400_000 && !substr) { void this.handleError('haste', new Error(`content over 400,000 characters (${content.length.toLocaleString()})`)); return { error: 'content too long' }; - } else { + } else if (content.length > 400_000) { content = content.substr(0, 400_000); isSubstr = true; } @@ -876,7 +877,7 @@ export class BushClientUtil extends ClientUtil { const haste = await this.haste(code, substr); hasteOut = `Too large to display. ${ haste.url - ? `Hastebin: ${haste.url}${haste.error ? `(${haste.error})` : ''}` + ? `Hastebin: ${haste.url}${haste.error ? ` - ${haste.error}` : ''}` : `${this.emojis.error} Hastebin: ${haste.error}` }`; } @@ -969,7 +970,7 @@ export class BushClientUtil extends ClientUtil { public async inspectCleanRedactHaste(input: any, inspectOptions?: BushInspectOptions) { input = typeof input !== 'string' ? this.inspect(input, inspectOptions ?? undefined) : input; input = this.redact(input); - return this.haste(input); + return this.haste(input, true); } public inspectAndRedact(input: any, inspectOptions?: BushInspectOptions) { @@ -1413,7 +1414,7 @@ export class BushClientUtil extends ClientUtil { }); } - public async resolveNonCachedUser(user: UserResolvable | undefined | null): Promise<User | undefined> { + public async resolveNonCachedUser(user: UserResolvable | undefined | null): Promise<BushUser | undefined> { if (!user) return undefined; const id = user instanceof User || user instanceof GuildMember || user instanceof ThreadMember |