aboutsummaryrefslogtreecommitdiff
path: root/src/bot.js
blob: 332f076a3e98c2c42dfeee70cd0f960553c6dad9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*********************************************
*
*	AleeBot for Discord servers
*	Copyright (C) 2017 AleeCorp 
*
**********************************************/
const Discord = require('discord.js');
const client = new Discord.Client(); 
const abVersion = "2.0.0"; 
const prefix = "abb:"
const config = require('./absettings.json'); 

client.on('ready', () => {
	console.log("[>] AleeBot is now ready!")
	console.log("Running version " + abVersion + ` and in ${client.guilds.size} guilds`)
	 client.user.setPresence({ 
        game: { 
            name: 'with version ' + abVersion, 
            type: 0 
        } 
	 });
	client.user.setStatus('online')
});


client.on("message", function(message) { 
    if (message.author.bot) return; 
    if (message.channel.type === "dm") return; 
    if (message.content.indexOf(config.prefix) !== 0) return;
	
	let command = message.content.split(" ")[0];
	command = command.slice(prefix.length);
 
	let args = message.content.split(" ").slice(1);
	
	if(command === 'test'){
		message.reply(`[SUCCESS] This command is temporarily so this command will be deleted\nRunning version ` + abVersion);
	}
	
});
client.login(config.abtoken).catch(function() { 
    console.log("[X] Login failed. Please contact Alee14#9928 or email him at alee14498@gmail.com."); 
});