Skip to content
Snippets Groups Projects
Commit 8521fdf2 authored by Reviath's avatar Reviath
Browse files

Update bot.js, events/ready.js, events/message.js files

parent 66573ac5
No related branches found
No related tags found
No related merge requests found
......@@ -5,10 +5,10 @@ const message = require('./events/message');
const fs = require('fs');
const settings = require('./settings.json');
client.commands = new discord.Collection();
client.aliases = new discord.Collection();
client.commands = new Discord.Collection();
client.aliases = new Discord.Collection();
ready.ready(client);
message.message(client, settings, discord);
message.message(client, settings, Discord);
fs.readdir("./commands/", (err, files) => {
......
module.exports = {
message: (bot, settings, discord) => {
message: (client, settings, Discord) => {
bot.on('message', async message => {
client.on('message', async message => {
let settings = require('../settings.json')
let prefix = settings.prefix;
......@@ -11,13 +11,13 @@ module.exports = {
let cmd = args.shift().toLowerCase();
let command;
if (!message.content.startsWith(prefix)) return;
if (bot.commands.has(cmd)) {
command = bot.commands.get(cmd);
} else if (bot.aliases.has(cmd)) {
command = bot.commands.get(bot.aliases.get(cmd));
if (client.commands.has(cmd)) {
command = client.commands.get(cmd);
} else if (client.aliases.has(cmd)) {
command = client.commands.get(client.aliases.get(cmd));
}
try {
command.run(bot, message, args);
command.run(client, message, args);
} catch (err) {
if (err) return undefined;
}
......
const settings = require('../settings.json');
module.exports = {
ready : (bot) => {
bot.login(settings.token)
bot.on('ready', async () => {
bot.user.setActivity({
ready : (client) => {
client.login(settings.token)
client.on('ready', async () => {
client.user.setActivity({
name: "Leviathan",
type: "WATCHING",
});
console.log(`${bot.user.tag} is ready!`);
console.log(`${client.user.tag} is ready!`);
});
}
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment