Compare commits
2 commits
fe0df783a3
...
1fad249b81
Author | SHA1 | Date | |
---|---|---|---|
1fad249b81 | |||
3954122d58 |
3 changed files with 18 additions and 13 deletions
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
.env
|
||||||
|
node_modules/
|
||||||
|
dist/
|
7
.prettierrc.json
Normal file
7
.prettierrc.json
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"tabWidth": 4,
|
||||||
|
"useTabs": true,
|
||||||
|
"semi": true,
|
||||||
|
"singleQuote": false,
|
||||||
|
"trailingComma": "none"
|
||||||
|
}
|
21
index.js
21
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
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -84,17 +78,18 @@ client.on("interactionCreate", async (interaction) => {
|
||||||
if (InteractionTypes.APPLICATION_COMMAND === interaction.type) {
|
if (InteractionTypes.APPLICATION_COMMAND === interaction.type) {
|
||||||
await interaction.defer();
|
await interaction.defer();
|
||||||
await interaction.deleteOriginal();
|
await interaction.deleteOriginal();
|
||||||
|
|
||||||
|
if(interaction.user.id !== "886685857560539176") {
|
||||||
|
return interaction.createFollowup({
|
||||||
|
content: "@everyone"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
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