commands?
This commit is contained in:
17
commands/utility/api.js
Normal file
17
commands/utility/api.js
Normal file
@@ -0,0 +1,17 @@
|
||||
const { SlashCommandBuilder } = require('discord.js');
|
||||
const torn = require('../../torn.js');
|
||||
|
||||
module.exports = {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('api')
|
||||
.setDescription('Directly request the Torn API')
|
||||
.addStringOption(option =>
|
||||
option.setName('url')
|
||||
.setDescription('Full URL excluding API key')),
|
||||
async execute(interaction) {
|
||||
const url = interaction.options.getString('url');
|
||||
const res = await torn.api(url)
|
||||
console.log(JSON.stringify(res))
|
||||
await interaction.reply("```json\n" + JSON.stringify(res) + "\n```");
|
||||
},
|
||||
};
|
||||
10
commands/utility/task.js
Normal file
10
commands/utility/task.js
Normal file
@@ -0,0 +1,10 @@
|
||||
const { SlashCommandBuilder } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('task')
|
||||
.setDescription('Execute a task.'),
|
||||
async execute(interaction) {
|
||||
await interaction.reply('todo');
|
||||
},
|
||||
};
|
||||
11
commands/utility/tasks.js
Normal file
11
commands/utility/tasks.js
Normal file
@@ -0,0 +1,11 @@
|
||||
const { SlashCommandBuilder } = require('discord.js');
|
||||
const torn = require('../../torn.js');
|
||||
|
||||
module.exports = {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('tasks')
|
||||
.setDescription('List tasks'),
|
||||
async execute(interaction) {
|
||||
await interaction.reply('todo');
|
||||
},
|
||||
};
|
||||
11
commands/utility/test.js
Normal file
11
commands/utility/test.js
Normal file
@@ -0,0 +1,11 @@
|
||||
const { SlashCommandBuilder } = require('discord.js');
|
||||
const torn = require('../../torn.js');
|
||||
|
||||
module.exports = {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('test')
|
||||
.setDescription('Test the Torn API'),
|
||||
async execute(interaction) {
|
||||
await interaction.reply(await torn.test());
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user