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: "...",
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue