remove eval
This commit is contained in:
parent
fe0df783a3
commit
3954122d58
1 changed files with 1 additions and 13 deletions
14
index.js
14
index.js
|
@ -68,12 +68,6 @@ client.on("ready", () => {
|
||||||
description: "...",
|
description: "...",
|
||||||
type: ApplicationCommandOptionTypes.BOOLEAN,
|
type: ApplicationCommandOptionTypes.BOOLEAN,
|
||||||
required: false
|
required: false
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "eval",
|
|
||||||
description: "...",
|
|
||||||
type: ApplicationCommandOptionTypes.BOOLEAN,
|
|
||||||
required: false
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -87,14 +81,8 @@ client.on("interactionCreate", async (interaction) => {
|
||||||
if (interaction.data.type === ApplicationCommandTypes.CHAT_INPUT) {
|
if (interaction.data.type === ApplicationCommandTypes.CHAT_INPUT) {
|
||||||
const content = interaction.data.options.getString("content", true);
|
const content = interaction.data.options.getString("content", true);
|
||||||
const raw = interaction.data.options.getBoolean("raw");
|
const raw = interaction.data.options.getBoolean("raw");
|
||||||
const shouldEval = interaction.data.options.getBoolean("eval");
|
|
||||||
|
|
||||||
interaction.createFollowup(
|
interaction.createFollowup(raw
|
||||||
shouldEval
|
|
||||||
? {
|
|
||||||
content: await evaluate(content, interaction)
|
|
||||||
}
|
|
||||||
: raw
|
|
||||||
? JSON.parse(content)
|
? JSON.parse(content)
|
||||||
: {
|
: {
|
||||||
content
|
content
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue