aboutsummaryrefslogtreecommitdiff
path: root/src/lib/extensions/discord-akairo
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-10-21 23:35:13 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-10-21 23:35:13 -0400
commit44521f4560dc8b0bab055685437d8fa65a34377f (patch)
tree4750c8cf696a2489964edc409e640f6792ed92b6 /src/lib/extensions/discord-akairo
parenta8b3f2d258d6ef19aeff2c9d60d6b08a91277b2b (diff)
downloadtanzanite-44521f4560dc8b0bab055685437d8fa65a34377f.tar.gz
tanzanite-44521f4560dc8b0bab055685437d8fa65a34377f.tar.bz2
tanzanite-44521f4560dc8b0bab055685437d8fa65a34377f.zip
misc
Diffstat (limited to 'src/lib/extensions/discord-akairo')
-rw-r--r--src/lib/extensions/discord-akairo/BushClientUtil.ts13
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;
}