rearrange commands folder
This commit is contained in:
17
commands/api/api.js
Normal file
17
commands/api/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```");
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user