aboutsummaryrefslogtreecommitdiff
path: root/src/lib/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/utils')
-rw-r--r--src/lib/utils/BushConstants.ts1
-rw-r--r--src/lib/utils/BushLogger.ts12
-rw-r--r--src/lib/utils/BushUtils.ts8
3 files changed, 12 insertions, 9 deletions
diff --git a/src/lib/utils/BushConstants.ts b/src/lib/utils/BushConstants.ts
index 0fd9113..abac4af 100644
--- a/src/lib/utils/BushConstants.ts
+++ b/src/lib/utils/BushConstants.ts
@@ -331,6 +331,7 @@ export const mappings = deepLock({
Admin: '<:admin:848963914628333598>',
Superuser: '<:superUser:848947986326224926>',
Developer: '<:developer:848954538111139871>',
+ Bot: '<:bot:1006929813203853427>',
BushVerified: '<:verfied:853360152090771497>',
BoostTier1: '<:boostitle:853363736679940127>',
BoostTier2: '<:boostitle:853363752728789075>',
diff --git a/src/lib/utils/BushLogger.ts b/src/lib/utils/BushLogger.ts
index 995dd82..21d10a0 100644
--- a/src/lib/utils/BushLogger.ts
+++ b/src/lib/utils/BushLogger.ts
@@ -1,6 +1,6 @@
import chalk from 'chalk';
// eslint-disable-next-line @typescript-eslint/no-unused-vars
-import { Client, EmbedBuilder, escapeMarkdown, Formatters, PartialTextBasedChannelFields, type Message } from 'discord.js';
+import { bold, Client, EmbedBuilder, escapeMarkdown, PartialTextBasedChannelFields, type Message } from 'discord.js';
import { stripVTControlCharacters as stripColor } from 'node:util';
import repl, { REPLServer, REPL_MODE_STRICT } from 'repl';
import { WriteStream } from 'tty';
@@ -77,7 +77,7 @@ function parseFormatting(
.split(/<<|>>/)
.map((value, index) => {
if (discordFormat) {
- return index % 2 === 0 ? escapeMarkdown(value) : Formatters.bold(escapeMarkdown(value));
+ return index % 2 === 0 ? escapeMarkdown(value) : bold(escapeMarkdown(value));
} else {
return index % 2 === 0 || !color ? value : chalk[color](value);
}
@@ -106,11 +106,9 @@ function inspectContent(content: any, depth = 2, colors = true): string {
function getTimeStamp(): string {
const now = new Date();
const minute = pad(now.getMinutes());
- const hour = pad(now.getHours() % 12);
- const meridiem = now.getHours() > 12 ? 'PM' : 'AM';
- const year = now.getFullYear().toString().slice(2).padStart(2, '0');
- const date = `${pad(now.getMonth() + 1)}/${pad(now.getDay())}/${year}`;
- return `${date} ${hour}:${minute} ${meridiem}`;
+ const hour = pad(now.getHours());
+ const date = `${pad(now.getMonth() + 1)}/${pad(now.getDay())}`;
+ return `${date} ${hour}:${minute}`;
}
/**
diff --git a/src/lib/utils/BushUtils.ts b/src/lib/utils/BushUtils.ts
index af173f9..de01ac0 100644
--- a/src/lib/utils/BushUtils.ts
+++ b/src/lib/utils/BushUtils.ts
@@ -466,9 +466,13 @@ export function clientSendAndPermCheck(
permissions: bigint[] = [],
checkChannel = false
): PermissionsString[] | null {
+ if (!message.inGuild() || !message.channel) return null;
+
const missing: PermissionsString[] = [];
- const sendPerm = message.channel!.isThread() ? 'SendMessages' : 'SendMessagesInThreads';
- if (!message.inGuild()) return null;
+ const sendPerm = message.channel.isThread() ? 'SendMessages' : 'SendMessagesInThreads';
+
+ // todo: remove once forum channels are fixed
+ if (message.channel.parent === null && message.channel.isThread()) return null;
if (!message.guild.members.me!.permissionsIn(message.channel!.id).has(sendPerm)) missing.push(sendPerm);