mirror of
https://github.com/ION606/selmerBot.git
synced 2026-06-05 23:06:14 +00:00
Added the playaudio command
This commit is contained in:
@@ -3,11 +3,12 @@ const Discord = require('discord.js');
|
||||
const { token } = require('./commands/currency/config.json');
|
||||
|
||||
|
||||
const client = new Client({
|
||||
const bot = new Client({
|
||||
intents: [
|
||||
Intents.FLAGS.GUILDS,
|
||||
Intents.FLAGS.GUILD_MESSAGES,
|
||||
Intents.FLAGS.GUILD_MESSAGE_REACTIONS
|
||||
Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
|
||||
Intents.FLAGS.GUILD_VOICE_STATES
|
||||
],
|
||||
});
|
||||
|
||||
@@ -16,11 +17,11 @@ const prefix = '/';
|
||||
|
||||
const fs = require('fs');
|
||||
const { exit } = require('process');
|
||||
client.commands = new Discord.Collection();
|
||||
bot.commands = new Discord.Collection();
|
||||
|
||||
client.commNames = new Discord.Collection();
|
||||
bot.commNames = new Discord.Collection();
|
||||
|
||||
client.econ = new Discord.Collection();
|
||||
bot.econ = new Discord.Collection();
|
||||
|
||||
const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js'));
|
||||
|
||||
@@ -30,31 +31,31 @@ let i = 0;
|
||||
for (const file of commandFiles) {
|
||||
const command = require(`./commands/${file}`);
|
||||
|
||||
client.commands.set(command.name, command);
|
||||
client.commNames.set(i, [command.name, command.description]);
|
||||
bot.commands.set(command.name, command);
|
||||
bot.commNames.set(i, [command.name, command.description]);
|
||||
i ++;
|
||||
}
|
||||
|
||||
//ECON SECTION
|
||||
client.commands.set('ECON', require(`./commands/currency/app.js`));
|
||||
bot.commands.set('ECON', require(`./commands/currency/app.js`));
|
||||
const currency = new Discord.Collection();
|
||||
const { Users } = require('./commands/currency/dbObjects.js');
|
||||
i++;
|
||||
|
||||
client.commNames.set('length', i);
|
||||
bot.commNames.set('length', i);
|
||||
|
||||
|
||||
client.on('ready', async () => {
|
||||
// client.once('ready', async () => {
|
||||
bot.on('ready', async () => {
|
||||
// bot.once('ready', async () => {
|
||||
const storedBalances = await Users.findAll();
|
||||
storedBalances.forEach(b => currency.set(b.user_id, b));
|
||||
|
||||
// console.log(`Logged in as ${client.user.tag}!`);
|
||||
// console.log(`Logged in as ${bot.user.tag}!`);
|
||||
console.log('SLEEMER BOT ONLINE!!!!! OH MY GOD OH MY GOD!!!');
|
||||
});
|
||||
|
||||
|
||||
client.on('messageCreate', (message) => {
|
||||
bot.on('messageCreate', (message) => {
|
||||
//COMMAND AREA
|
||||
//Check if the prefix exists
|
||||
if (!message.content.startsWith(prefix) || message.author.bot) return;
|
||||
@@ -66,38 +67,38 @@ client.on('messageCreate', (message) => {
|
||||
//Check if the user has sufficient permission
|
||||
//Performes the command
|
||||
switch(command) {
|
||||
case 'test': client.commands.get('Hello World').execute(message, args);
|
||||
case 'test': bot.commands.get('Hello World').execute(message, args);
|
||||
break;
|
||||
|
||||
case 'profile': client.commands.get('profile').execute(message, args, Discord);
|
||||
case 'profile': bot.commands.get('profile').execute(message, args, Discord);
|
||||
break;
|
||||
|
||||
case 'links': client.commands.get('links').execute(message, args, Discord);
|
||||
case 'links': bot.commands.get('links').execute(message, args, Discord);
|
||||
break;
|
||||
|
||||
case 'arrow': client.commands.get('arrow').execute(message, args, Discord);
|
||||
case 'arrow': bot.commands.get('arrow').execute(message, args, Discord);
|
||||
break;
|
||||
|
||||
case 'playaudio': client.commands.get('playaudio').execute(message, args, client, Discord);
|
||||
case 'playaudio': bot.commands.get('playaudio').execute(message, args, bot, Discord);
|
||||
break;
|
||||
|
||||
case 'quotes': client.commands.get('quotes').execute(message, args, Discord, Client);
|
||||
case 'quotes': bot.commands.get('quotes').execute(message, args, Discord, Client);
|
||||
break;
|
||||
|
||||
case 'extracredit': client.commands.get('EC').execute(message);
|
||||
case 'extracredit': bot.commands.get('EC').execute(message);
|
||||
break;
|
||||
|
||||
case 'scrape': client.commands.get('scraper').execute(message, args);
|
||||
case 'scrape': bot.commands.get('scraper').execute(message, args);
|
||||
break;
|
||||
|
||||
case 'kareoke': client.commands.get('kareoke').execute(message, args);
|
||||
case 'kareoke': bot.commands.get('kareoke').execute(message, args);
|
||||
break;
|
||||
|
||||
default: client.commands.get('ECON').execute(client, prefix, message, args, command, Users, currency);
|
||||
default: bot.commands.get('ECON').execute(bot, prefix, message, args, command, Users, currency);
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
//Last Line
|
||||
client.login(token);
|
||||
bot.login(token);
|
||||
Reference in New Issue
Block a user