Update commands to slash commands
This commit is contained in:
@@ -1,5 +1,33 @@
|
||||
var libCore = require("../libCore.js");
|
||||
|
||||
const { SlashCommandBuilder } = require('discord.js');
|
||||
const { DebugBuilder } = require("../utilities/debugBuilder");
|
||||
const log = new DebugBuilder("server", "sources");
|
||||
|
||||
module.exports = {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('sources')
|
||||
.setDescription('Replies with your input!'),
|
||||
example: "sources",
|
||||
isPrivileged: false,
|
||||
requiresTokens: false,
|
||||
async execute(interaction) {
|
||||
try{
|
||||
var sourceArray = libCore.getSources();
|
||||
var sourceString = "";
|
||||
|
||||
sourceArray.forEach(source => {
|
||||
sourceString +=`[${source.title}](${source.link}) \n`;
|
||||
});
|
||||
|
||||
await interaction.reply(sourceString);
|
||||
}catch(err){
|
||||
log.ERROR(err)
|
||||
//await interaction.reply(err.toString());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
name: 'sources',
|
||||
description: 'List RSS Sources',
|
||||
|
||||
Reference in New Issue
Block a user