Add stop functionality, fix duration
This commit is contained in:
62
index.js
62
index.js
@@ -2,7 +2,8 @@ const { Client, GatewayIntentBits } = require('discord.js');
|
||||
const { registerCommands } = require('./utils/registerCommands');
|
||||
const { playCommand } = require('./commands/play');
|
||||
const { queueCommand } = require('./commands/queue');
|
||||
const { pauseCommand, unpauseCommand } = require('./commands/pause_resume');
|
||||
const { stopCommand } = require('./commands/stop');
|
||||
const { pauseCommand, unpauseCommand } = require('./commands/pauseResume');
|
||||
const { toggleLoopCommand } = require('./commands/loop');
|
||||
const { ReAuth } = require('./ReAuthenticate');
|
||||
|
||||
@@ -11,13 +12,14 @@ const clientId = process.parsed.clientId;
|
||||
const token = process.parsed.token;
|
||||
|
||||
const client = new Client({
|
||||
intents: [
|
||||
GatewayIntentBits.Guilds,
|
||||
GatewayIntentBits.GuildMessages,
|
||||
GatewayIntentBits.MessageContent,
|
||||
GatewayIntentBits.GuildVoiceStates,
|
||||
GatewayIntentBits.GuildIntegrations
|
||||
] })
|
||||
intents: [
|
||||
GatewayIntentBits.Guilds,
|
||||
GatewayIntentBits.GuildMessages,
|
||||
GatewayIntentBits.MessageContent,
|
||||
GatewayIntentBits.GuildVoiceStates,
|
||||
GatewayIntentBits.GuildIntegrations
|
||||
]
|
||||
})
|
||||
|
||||
client.on('ready', async () => {
|
||||
console.log(`Logged in as ${client.user.tag}!`);
|
||||
@@ -26,27 +28,29 @@ client.on('ready', async () => {
|
||||
});
|
||||
|
||||
client.on('interactionCreate', async (interaction) => {
|
||||
if (!interaction.isCommand()) return;
|
||||
if (!interaction.isCommand()) return;
|
||||
|
||||
const { commandName } = interaction;
|
||||
|
||||
if (commandName === 'play') {
|
||||
await playCommand(interaction);
|
||||
} else if (commandName === 'queue') {
|
||||
await queueCommand(interaction);
|
||||
} else if (commandName === 'pause') {
|
||||
await pauseCommand(interaction);
|
||||
} else if (commandName === 'resume') {
|
||||
await unpauseCommand(interaction);
|
||||
} else if (commandName === 'loop') {
|
||||
await toggleLoopCommand(interaction);
|
||||
} else if (commandName === 'stop') {
|
||||
await stopCommand(interaction);
|
||||
}
|
||||
});
|
||||
|
||||
const { commandName } = interaction;
|
||||
|
||||
if (commandName === 'play') {
|
||||
await playCommand(interaction);
|
||||
} else if (commandName === 'queue') {
|
||||
await queueCommand(interaction);
|
||||
} else if (commandName === 'pause') {
|
||||
await pauseCommand(interaction);
|
||||
} else if (commandName === 'resume') {
|
||||
await unpauseCommand(interaction);
|
||||
} else if (commandName === 'loop') {
|
||||
await toggleLoopCommand(interaction);
|
||||
}
|
||||
});
|
||||
|
||||
client.on('messageCreate', async (message) => {
|
||||
if(message.content == 'reauth') {
|
||||
await ReAuth();
|
||||
}
|
||||
});
|
||||
client.on('messageCreate', async (message) => {
|
||||
if(message.content == 'reauth') {
|
||||
await ReAuth();
|
||||
}
|
||||
});
|
||||
|
||||
client.login(token);
|
||||
Reference in New Issue
Block a user