diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-10-21 23:35:13 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-10-21 23:35:13 -0400 |
commit | 44521f4560dc8b0bab055685437d8fa65a34377f (patch) | |
tree | 4750c8cf696a2489964edc409e640f6792ed92b6 /src/lib/extensions | |
parent | a8b3f2d258d6ef19aeff2c9d60d6b08a91277b2b (diff) | |
download | tanzanite-44521f4560dc8b0bab055685437d8fa65a34377f.tar.gz tanzanite-44521f4560dc8b0bab055685437d8fa65a34377f.tar.bz2 tanzanite-44521f4560dc8b0bab055685437d8fa65a34377f.zip |
misc
Diffstat (limited to 'src/lib/extensions')
-rw-r--r-- | src/lib/extensions/discord-akairo/BushClientUtil.ts | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/lib/extensions/discord-akairo/BushClientUtil.ts b/src/lib/extensions/discord-akairo/BushClientUtil.ts index 499d2c7..a833c75 100644 --- a/src/lib/extensions/discord-akairo/BushClientUtil.ts +++ b/src/lib/extensions/discord-akairo/BushClientUtil.ts @@ -223,12 +223,11 @@ export class BushClientUtil extends ClientUtil { * * Embed Description Limit = 4096 characters * * Embed Field Limit = 1024 characters */ - public async codeblock(code: string, length: number, language?: CodeBlockLang, substr = false): Promise<string> { + public async codeblock(code: string, length: number, language: CodeBlockLang | '' = '', substr = false): Promise<string> { let hasteOut = ''; code = this.discord.escapeCodeBlock(code); const prefix = `\`\`\`${language}\n`; const suffix = '\n```'; - language = language ?? 'txt'; if (code.length + (prefix + suffix).length >= length) { const haste = await this.haste(code, substr); hasteOut = `Too large to display. ${ @@ -322,7 +321,7 @@ export class BushClientUtil extends ClientUtil { */ public async inspectCleanRedactCodeblock( input: any, - language?: CodeBlockLang, + language?: CodeBlockLang | '', inspectOptions?: BushInspectOptions, length = 1024 ) { @@ -653,6 +652,14 @@ export class BushClientUtil extends ClientUtil { return missing.length ? missing : null; } + public prefix(message: BushMessage | BushSlashMessage): string { + return message.util.isSlash + ? '/' + : client.config.isDevelopment + ? 'dev ' + : message.util.parsed?.prefix ?? client.config.prefix; + } + public get arg() { return Arg; } |