Skip to content

Commit

Permalink
remove submission channel lacklist
Browse files Browse the repository at this point in the history
you can just turn off slash commands in that channel lol
  • Loading branch information
3vorp committed Dec 7, 2023
1 parent f98de55 commit c87d00e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
4 changes: 0 additions & 4 deletions lang/en-US/commands.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@
"description": "You cannot botban yourself, a developer, or someone with administrator permissions."
}
},
"in_submission": {
"title": "You cannot run slash commands in a submission channel!",
"description": "Please use the appropriate bot command channel instead."
},
"images": {
"too_big": "This image is too big to %ACTION%!",
"actions": {
Expand Down
21 changes: 1 addition & 20 deletions src/events/slashCommandUsed.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,12 @@
import { SlashCommandI } from "@interfaces/commands";
import { Submissions } from "@interfaces/firestorm";
import { Collection } from "discord.js";
import { Event } from "@interfaces/events";
import { Client, ChatInputCommandInteraction, EmbedBuilder } from "@client";
import { colors } from "@utility/colors";
import axios from "axios";
import { Client, ChatInputCommandInteraction } from "@client";

export default {
name: "slashCommandUsed",
async execute(client: Client, interaction: ChatInputCommandInteraction) {
client.storeAction("slashCommand", interaction);
const packs: Submissions = (await axios.get(`${client.tokens.apiUrl}settings/submission.packs`))
.data;

const submissionChannels = Object.values(packs).map((pack) => pack.channels.submit);

// disable commands
if (submissionChannels.includes(interaction.channel.id))
return interaction.reply({
embeds: [
new EmbedBuilder()
.setTitle(interaction.strings().command.in_submission.title)
.setDescription(interaction.strings().command.in_submission.description)
.setColor(colors.red),
],
ephemeral: true,
});

// get command name
const { commandName } = interaction;
Expand Down

0 comments on commit c87d00e

Please sign in to comment.