main.js 1.49 KB
//bot basic primer
import {Discord} from 'discord.js'

const client = new Discord.Client();

const prefix = ';';

import {fs} from 'fs';

client.commands = new Discord.Collection();

const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));

import breathe from './commands/breathe.js';
import calm from './commands/calm.js';
import chat from './commands/chat.js';
import checklist from './commands/checklist.js';
import cute from './commands/cute.js';
import help from './commands/help.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');