updated file names
This commit is contained in:
19
dist/index.js
vendored
19
dist/index.js
vendored
@@ -29,31 +29,30 @@ const CLIENT = new discord_js_1.Client({ intents: [discord_js_1.Intents.FLAGS.GU
|
||||
//init logs with a timestamp
|
||||
console.log(new Date().toISOString() + '\n\n');
|
||||
//get token
|
||||
if (!fs.existsSync('./token')) {
|
||||
fs.writeFileSync('./token', '');
|
||||
if (!fs.existsSync('./token.txt')) {
|
||||
fs.writeFileSync('./token.txt', '');
|
||||
console.error('Missing Discord Token, please enter the bot token into the token file');
|
||||
process.exit(1);
|
||||
}
|
||||
const TOKEN = fs.readFileSync('./token').toString();
|
||||
const TOKEN = fs.readFileSync('./token.txt').toString();
|
||||
//discord connections
|
||||
CLIENT.on('ready', client => {
|
||||
console.log(`Logged in as ${client.user.tag}`);
|
||||
client.guilds.fetch().then(guilds => (0, discord_1.registerCommands)(TOKEN, client.user.id, guilds.map(g => g.id)));
|
||||
(0, queue_1.discordInit)(client);
|
||||
});
|
||||
CLIENT.on('interactionCreate', async (interaction) => {
|
||||
if (!interaction.isCommand())
|
||||
return;
|
||||
try {
|
||||
if (interaction.commandName === 'queue')
|
||||
await (0, queue_1.createQueue)(interaction);
|
||||
await queue_1.QueueCommands.queue(interaction);
|
||||
else if (interaction.commandName === 'join')
|
||||
await (0, queue_1.joinQueue)(interaction);
|
||||
await queue_1.QueueCommands.join(interaction);
|
||||
else if (interaction.commandName === 'leave')
|
||||
await (0, queue_1.leaveQueue)(interaction);
|
||||
else if (interaction.commandName === 'ready')
|
||||
await (0, queue_1.readyQueue)(interaction);
|
||||
else if (interaction.commandName === 'cancel')
|
||||
await (0, queue_1.cancelQueue)(interaction);
|
||||
await queue_1.QueueCommands.leave(interaction);
|
||||
else if (interaction.commandName === 'stop')
|
||||
await queue_1.QueueCommands.stop(interaction);
|
||||
else if (interaction.commandName === 'player')
|
||||
await (0, api_1.getPlayerInteraction)(interaction);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user