aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-09-19 15:50:05 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-09-19 15:50:05 -0400
commitc6e0b564bf742ff772a24fd8c0c8d37acccce80e (patch)
treeab60f7ff22598ba70331a9686ec13b64a6abfaa0
parent98477a07a4a225e2a36cbe6c2c2cefd1d3c0a82e (diff)
downloadtanzanite-c6e0b564bf742ff772a24fd8c0c8d37acccce80e.tar.gz
tanzanite-c6e0b564bf742ff772a24fd8c0c8d37acccce80e.tar.bz2
tanzanite-c6e0b564bf742ff772a24fd8c0c8d37acccce80e.zip
some minor fixes
-rw-r--r--src/commands/moderation/modlog.ts6
-rw-r--r--src/lib/extensions/discord-akairo/BushClientUtil.ts6
-rw-r--r--src/listeners/other/consoleListener.ts4
3 files changed, 9 insertions, 7 deletions
diff --git a/src/commands/moderation/modlog.ts b/src/commands/moderation/modlog.ts
index c72ff39..0eb7392 100644
--- a/src/commands/moderation/modlog.ts
+++ b/src/commands/moderation/modlog.ts
@@ -27,7 +27,7 @@ export default class ModlogCommand extends BushCommand {
default: false
}
],
- userPermissions: ['MANAGE_MESSAGES'],
+ userPermissions: [],
slash: true,
slashOptions: [
{
@@ -62,6 +62,10 @@ export default class ModlogCommand extends BushCommand {
message: BushMessage | BushSlashMessage,
{ search, hidden }: { search: BushUser | string; hidden: boolean }
): Promise<unknown> {
+ if (!message.member?.permissions.has('MANAGE_MESSAGES'))
+ return await message.util.reply(
+ `${util.emojis.error} You must have the **Manage Message** permission to use this command.`
+ );
const foundUser = search instanceof User ? search : await util.resolveUserAsync(search);
if (foundUser) {
const logs = await ModLog.findAll({
diff --git a/src/lib/extensions/discord-akairo/BushClientUtil.ts b/src/lib/extensions/discord-akairo/BushClientUtil.ts
index 2345ac7..64616f0 100644
--- a/src/lib/extensions/discord-akairo/BushClientUtil.ts
+++ b/src/lib/extensions/discord-akairo/BushClientUtil.ts
@@ -32,6 +32,7 @@ import {
CommandInteraction,
Constants,
GuildMember,
+ InteractionReplyOptions,
Message,
MessageActionRow,
MessageButton,
@@ -986,8 +987,7 @@ export class BushClientUtil extends ClientUtil {
): Promise<Message | APIMessage | undefined> {
const newResponseOptions = typeof responseOptions === 'string' ? { content: responseOptions } : responseOptions;
if (interaction.replied || interaction.deferred) {
- // @ts-expect-error: stop being dumb
- delete newResponseOptions.ephemeral; // Cannot change a preexisting message to be ephemeral
+ delete (newResponseOptions as InteractionReplyOptions).ephemeral; // Cannot change a preexisting message to be ephemeral
return (await interaction.editReply(newResponseOptions)) as Message | APIMessage;
} else {
await interaction.reply(newResponseOptions);
@@ -1190,8 +1190,6 @@ export class BushClientUtil extends ClientUtil {
const guild = client.guilds.resolveId(options.guild)!;
const type = this.#findTypeEnum(options.type)!;
- console.debug(expires);
-
const entry = ActivePunishment.build(
options.extraInfo
? { user, type, guild, expires, modlog: options.modlog, extraInfo: options.extraInfo }
diff --git a/src/listeners/other/consoleListener.ts b/src/listeners/other/consoleListener.ts
index 0954fb4..6092f05 100644
--- a/src/listeners/other/consoleListener.ts
+++ b/src/listeners/other/consoleListener.ts
@@ -47,8 +47,8 @@ export default class ConsoleListener extends BushListener {
getters: true,
maxArrayLength: Infinity,
maxStringLength: Infinity,
- depth: depth ?? 2,
- hidden: hidden
+ depth: +(depth ?? 2),
+ showHidden: hidden
});
} catch (e) {
console.error(e);