main.js 1.25 KB
//bot basic primer
const Discord = require('discord.js');

const client = new Discord.Client();

const prefix = ';';

const fs = require('fs');

client.commands = new Discord.Collection();

const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
for(const file of commandFiles){
    const command = require(`./commands/${file}`);
    client.commands.set(command.name, command);
}

client.once('ready', () => {
    console.log('anxietymanager is online')
});


//Command Calls
client.on('message', message => {
    if(!message.content.startsWith(prefix))   return;

    const args = message.content.slice(prefix.length).split(/ +/);
    const command = args.shift().toLowerCase();

    if(command == 'ping'){
        message.channel.send('pong!');
    } else if(command == 'help'){
        client.commands.get('help').execute(message, args);
    } else if(command == 'calm'){
        client.commands.get('calm').execute(message, args, Discord);
    } else if(command == 'breathe'){
        client.commands.get('breathe').execute(message, args);
    } else if(command == 'cute'){
        client.commands.get('cute').execute(message, args, Discord);
    }
});

 

client.login('OTgwOTAxNzg3MzY2MjE1Njgw.GVFGdS.z9ily3n-7rcJnqf2FrHg3KJn5h_u68llQzJOGU');