commands?

This commit is contained in:
2025-04-06 06:33:46 -04:00
parent d899e8e873
commit 4ace928563
8 changed files with 164 additions and 16 deletions

17
commands/utility/api.js Normal file
View 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
View 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
View 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
View 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());
},
};