Skip to content

Commit

Permalink
restrict /echo to #bot-playground (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
Madjosz authored Oct 12, 2023
1 parent b986cde commit 9b2120f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/commands/echo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
strikethrough,
underscore,
} from "discord.js";
import { checkBotPlayground } from "../common";

const formats: { [k: string]: (s: string) => string } = {
blockQuote,
Expand Down Expand Up @@ -40,6 +41,7 @@ export const data = async () =>
.toJSON();

export const call = async (interaction: ChatInputCommandInteraction) => {
checkBotPlayground(false, interaction);
const input = interaction.options.getString("input", true);
const format = interaction.options.getString("format");
const msg = format && formats.hasOwnProperty(format) ? formats[format](input) : input;
Expand Down

0 comments on commit 9b2120f

Please sign in to comment.