Cast some nets
This commit is contained in:
parent
256956df73
commit
9da9926fac
|
@ -26,6 +26,9 @@ import { BotClient } from "../bot";
|
|||
import { dt } from "../main";
|
||||
import { StoreMan } from "../storeman";
|
||||
import getRandomColor from "../utils/getRandomColor";
|
||||
import Logger from "../utils/Logger";
|
||||
|
||||
const logger = new Logger("(/) confess");
|
||||
|
||||
export const data = new SlashCommandBuilder()
|
||||
.setName("confess")
|
||||
|
@ -38,6 +41,7 @@ export const data = new SlashCommandBuilder()
|
|||
);
|
||||
|
||||
export async function execute(interaction: CommandInteraction) {
|
||||
try {
|
||||
if (dt.isBanned(interaction.guild?.id!, interaction.user.id)) {
|
||||
return interaction.reply({
|
||||
content: "You are banned from confessions in this server!",
|
||||
|
@ -102,4 +106,7 @@ export async function execute(interaction: CommandInteraction) {
|
|||
content: "Confession sent!",
|
||||
ephemeral: true,
|
||||
});
|
||||
} catch (err) {
|
||||
logger.error("An error occured:", err);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,6 +18,9 @@
|
|||
|
||||
import { CommandInteraction, PermissionFlagsBits, SlashCommandBuilder } from "discord.js";
|
||||
import { dt } from "../main";
|
||||
import Logger from "../utils/Logger";
|
||||
|
||||
const logger = new Logger("(/) confessban");
|
||||
|
||||
export const data = new SlashCommandBuilder()
|
||||
.setName("confessban")
|
||||
|
@ -37,6 +40,7 @@ export async function execute(interaction: CommandInteraction) {
|
|||
interaction.options.getString("id")
|
||||
);
|
||||
|
||||
try {
|
||||
return result
|
||||
? interaction.reply({
|
||||
content: "User was banned.",
|
||||
|
@ -46,4 +50,7 @@ export async function execute(interaction: CommandInteraction) {
|
|||
content: "No confession with that ID was found.",
|
||||
ephemeral: true
|
||||
});
|
||||
} catch (err) {
|
||||
logger.error("An error occured:", err);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,9 @@ import { CommandInteraction, EmbedBuilder, SlashCommandBuilder, TextChannel } fr
|
|||
import { dt } from "../main";
|
||||
import { BotClient } from "../bot";
|
||||
import getRandomColor from "../utils/getRandomColor";
|
||||
import Logger from "../utils/Logger";
|
||||
|
||||
const logger = new Logger("(/) confessdel");
|
||||
|
||||
export const data = new SlashCommandBuilder()
|
||||
.setName("confessdel")
|
||||
|
@ -45,6 +48,7 @@ export async function execute(interaction: CommandInteraction) {
|
|||
const result = dt.getConfession(interaction.guild?.id!, idVal);
|
||||
|
||||
if (result) {
|
||||
try {
|
||||
const confession = dt.getConfession(interaction.guild?.id!, idVal)?.messageId;
|
||||
const channelId = dt.getGuildInfo(interaction.guild?.id!)?.settings.confessChannel!;
|
||||
const emptyEmbed = new EmbedBuilder()
|
||||
|
@ -64,7 +68,10 @@ export async function execute(interaction: CommandInteraction) {
|
|||
return interaction.reply({
|
||||
content: "Confession removed.",
|
||||
ephemeral: true
|
||||
})
|
||||
});
|
||||
} catch (err) {
|
||||
logger.error("An error occured:", err);
|
||||
}
|
||||
} else {
|
||||
return interaction.reply({
|
||||
content: "Either the confession wasn't found or you may not be allowed to remove it.",
|
||||
|
|
|
@ -18,6 +18,9 @@
|
|||
|
||||
import { CommandInteraction, PermissionFlagsBits, SlashCommandBuilder } from "discord.js";
|
||||
import { dt } from "../main";
|
||||
import Logger from "../utils/Logger";
|
||||
|
||||
const logger = new Logger("(/) confesspardon");
|
||||
|
||||
export const data = new SlashCommandBuilder()
|
||||
.setName("confesspardon")
|
||||
|
@ -37,6 +40,7 @@ export function execute(interaction: CommandInteraction) {
|
|||
interaction.options.getString("id")
|
||||
);
|
||||
|
||||
try {
|
||||
return result
|
||||
? interaction.reply({
|
||||
content: "User was unbanned.",
|
||||
|
@ -46,4 +50,7 @@ export function execute(interaction: CommandInteraction) {
|
|||
content: "No confession with that ID was found.",
|
||||
ephemeral: true
|
||||
});
|
||||
} catch (err) {
|
||||
logger.error("An error occured:", err);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,6 +28,8 @@ import {
|
|||
import { dt } from "../main";
|
||||
import Logger from "../utils/Logger";
|
||||
|
||||
const logger = new Logger("(/) setup");
|
||||
|
||||
export const data = new SlashCommandBuilder()
|
||||
.setName("setup")
|
||||
.setDescription("Setup the bot.")
|
||||
|
@ -52,6 +54,7 @@ export async function execute(interaction: CommandInteraction) {
|
|||
const channelRow =
|
||||
new ActionRowBuilder<ChannelSelectMenuBuilder>().addComponents(channelList);
|
||||
|
||||
try {
|
||||
const response = await interaction.reply({
|
||||
content: `# Let's get started, ${interaction.user.displayName}!\nFirst, let's choose a channel for your confessions.`,
|
||||
ephemeral: true,
|
||||
|
@ -131,4 +134,7 @@ export async function execute(interaction: CommandInteraction) {
|
|||
components: []
|
||||
});
|
||||
});
|
||||
} catch (err) {
|
||||
logger.error("An error occured:", err);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue