1
0
mirror of https://gitlab.com/Emeraude/music-very-player.git synced 2024-09-07 22:51:20 +02:00
music-very-player/index.js
Arthur Poulet 74159c7259 Improve all manager and config
* Guilds now handles the link command -> action
* Config specifies the links
* The player is independant from the input
2021-01-27 00:00:44 +01:00

28 lines
667 B
JavaScript
Executable File

#!/usr/bin/env node
const Discord = require('discord.js')
const { GuildsManager } = require ('./src/guilds_manager')
const client = new Discord.Client()
const guild_manager = new GuildsManager()
let index = 0;
console.time("ready")
client.once('ready', () => {
console.timeEnd("ready")
console.log("= MVP BOT IS READY =")
client.on('message', message => {
const current_index = index++;
console.log("> NEW MESSAGE", current_index)
try {
guild_manager.handle_message(message)
} catch (err) {
console.error('> catch err', err)
}
console.log("> FINISH", current_index)
})
})
client.login(process.env['DISCORD_API_KEY'])