Compare commits

...

2 commits

Author SHA1 Message Date
1fad249b81
add owner check 2025-04-30 19:38:53 -04:00
3954122d58
remove eval 2025-04-30 19:27:13 -04:00
3 changed files with 18 additions and 13 deletions

3
.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
.env
node_modules/
dist/

7
.prettierrc.json Normal file
View file

@ -0,0 +1,7 @@
{
"tabWidth": 4,
"useTabs": true,
"semi": true,
"singleQuote": false,
"trailingComma": "none"
}

View file

@ -68,12 +68,6 @@ client.on("ready", () => {
description: "...",
type: ApplicationCommandOptionTypes.BOOLEAN,
required: false
},
{
name: "eval",
description: "...",
type: ApplicationCommandOptionTypes.BOOLEAN,
required: false
}
]
}
@ -84,17 +78,18 @@ client.on("interactionCreate", async (interaction) => {
if (InteractionTypes.APPLICATION_COMMAND === interaction.type) {
await interaction.defer();
await interaction.deleteOriginal();
if(interaction.user.id !== "886685857560539176") {
return interaction.createFollowup({
content: "@everyone"
});
}
if (interaction.data.type === ApplicationCommandTypes.CHAT_INPUT) {
const content = interaction.data.options.getString("content", true);
const raw = interaction.data.options.getBoolean("raw");
const shouldEval = interaction.data.options.getBoolean("eval");
interaction.createFollowup(
shouldEval
? {
content: await evaluate(content, interaction)
}
: raw
interaction.createFollowup(raw
? JSON.parse(content)
: {
content