Halfbroken fixes
This commit is contained in:
68
index.js
68
index.js
@@ -1,4 +1,5 @@
|
||||
const { Client, GatewayIntentBits } = require('discord.js');
|
||||
const process = require('dotenv').config();
|
||||
const { registerCommands } = require('./utils/registerCommands');
|
||||
const { playCommand } = require('./commands/play');
|
||||
const { queueCommand } = require('./commands/queue');
|
||||
@@ -7,50 +8,49 @@ const { pauseCommand, unpauseCommand } = require('./commands/pauseResume');
|
||||
const { toggleLoopCommand } = require('./commands/loop');
|
||||
const { ReAuth } = require('./reAuthenticate');
|
||||
|
||||
const process = require('dotenv').config();
|
||||
const clientId = process.parsed.clientId;
|
||||
const token = process.parsed.token;
|
||||
const { clientId } = process.parsed;
|
||||
const { token } = process.parsed;
|
||||
|
||||
const client = new Client({
|
||||
intents: [
|
||||
GatewayIntentBits.Guilds,
|
||||
GatewayIntentBits.GuildMessages,
|
||||
GatewayIntentBits.MessageContent,
|
||||
GatewayIntentBits.GuildVoiceStates,
|
||||
GatewayIntentBits.GuildIntegrations
|
||||
]
|
||||
})
|
||||
const client = new Client({
|
||||
intents: [
|
||||
GatewayIntentBits.Guilds,
|
||||
GatewayIntentBits.GuildMessages,
|
||||
GatewayIntentBits.MessageContent,
|
||||
GatewayIntentBits.GuildVoiceStates,
|
||||
GatewayIntentBits.GuildIntegrations,
|
||||
],
|
||||
});
|
||||
|
||||
client.on('ready', async () => {
|
||||
console.log(`Logged in as ${client.user.tag}!`);
|
||||
|
||||
await registerCommands(clientId, token);
|
||||
console.log(`Logged in as ${client.user.tag}!`);
|
||||
|
||||
await registerCommands(clientId, token);
|
||||
});
|
||||
|
||||
client.on('interactionCreate', async (interaction) => {
|
||||
if (!interaction.isCommand()) return;
|
||||
if (!interaction.isCommand()) return;
|
||||
|
||||
const { commandName } = 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);
|
||||
} else if (commandName === 'stop') {
|
||||
await stopCommand(interaction);
|
||||
}
|
||||
if (commandName === 'play') {
|
||||
await playCommand(interaction, client);
|
||||
} 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);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
client.on('messageCreate', async (message) => {
|
||||
if(message.content == 'reauth') {
|
||||
await ReAuth();
|
||||
}
|
||||
if (message.content === 'reauth') {
|
||||
await ReAuth();
|
||||
}
|
||||
});
|
||||
|
||||
client.login(token);
|
||||
|
||||
Reference in New Issue
Block a user