29 lines
816 B
JavaScript
29 lines
816 B
JavaScript
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('Reply with all of the available sources'),
|
|
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());
|
|
}
|
|
}
|
|
}; |