aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlee14 <Alee14498@gmail.com>2017-10-22 12:49:49 -0400
committerAlee14 <Alee14498@gmail.com>2017-10-22 12:49:49 -0400
commit7cc7c8984b532b1dc12c720c045a23bc827a553c (patch)
treed3171ac353a67300065455a00c50bb968acb334c /src
parentfc1418f89362c1b637026dc8f6a13ab4bb195762 (diff)
downloadAleeBot-7cc7c8984b532b1dc12c720c045a23bc827a553c.tar.gz
AleeBot-7cc7c8984b532b1dc12c720c045a23bc827a553c.tar.bz2
AleeBot-7cc7c8984b532b1dc12c720c045a23bc827a553c.zip
Beautifing AleeBot
Diffstat (limited to 'src')
-rw-r--r--src/bot.js131
-rw-r--r--src/index.js65
-rw-r--r--src/renderer.js0
-rw-r--r--src/setup.html32
4 files changed, 126 insertions, 102 deletions
diff --git a/src/bot.js b/src/bot.js
index 2cb57d4..c9972e3 100644
--- a/src/bot.js
+++ b/src/bot.js
@@ -1,88 +1,89 @@
/*********************************************
-*
-* AleeBot for Discord servers
-* Copyright (C) 2017 AleeCorp
-*
-**********************************************/
+ *
+ * AleeBot for Discord servers
+ * Copyright (C) 2017 AleeCorp
+ * License: MIT
+ *
+ **********************************************/
const Discord = require('discord.js');
-const client = new Discord.Client();
-const abVersion = "2.0.0 Beta";
+const client = new Discord.Client();
+const abVersion = "2.0.0 Beta";
const prefix = "abb:"
-const config = require('./absettings.json');
+const config = require('./absettings.json');
client.on('ready', () => {
- console.log("[>] AleeBot is now ready!")
- console.log("[i] Running version " + abVersion + ` and in ${client.guilds.size} guilds`)
- client.user.setPresence({
- game: {
- name: `ab:help | ${client.guilds.size} servers`,
- type: 0
- }
- });
- client.user.setStatus('online')
+ console.log("[>] AleeBot is now ready!")
+ console.log("[i] Running version " + abVersion + ` and in ${client.guilds.size} guilds`)
+ client.user.setPresence({
+ game: {
+ name: `ab:help | ${client.guilds.size} servers`,
+ type: 0
+ }
+ });
+ client.user.setStatus('online')
});
client.on("guildCreate", guild => {
-
+
console.log(`[i] New guild joined: ${guild.name} (id: ${guild.id}). This guild has ${guild.memberCount} members!`);
-
- client.user.setPresence({
- game: {
- name: `ab:help | ${client.guilds.size} servers`,
- type: 0
- }
- });
-
+
+ client.user.setPresence({
+ game: {
+ name: `ab:help | ${client.guilds.size} servers`,
+ type: 0
+ }
+ });
+
});
-
-
+
+
client.on("guildDelete", guild => {
-
+
console.log(`[i] I have been removed from: ${guild.name} (id: ${guild.id})`);
-
- client.user.setPresence({
- game: {
- name: `ab:help | ${client.guilds.size} servers`,
- type: 0
- }
- });
-
-
+
+ client.user.setPresence({
+ game: {
+ name: `ab:help | ${client.guilds.size} servers`,
+ type: 0
+ }
+ });
+
+
});
client.on('guildMemberAdd', member => {
- member.guild.channels.find("name", "welcomes-and-byes").sendMessage(member.toString() + " has joined the server");
+ member.guild.channels.find("name", "welcomes-and-byes").sendMessage(member.toString() + " has joined the server");
});
client.on('guildMemberRemove', member => {
- member.guild.channels.find("name", "welcomes-and-byes").sendMessage(`**${member.user.username}** has left the server`);
+ member.guild.channels.find("name", "welcomes-and-byes").sendMessage(`**${member.user.username}** has left the server`);
});
-client.on("message", function(message) {
- if (message.author.bot) return;
- if (message.channel.type === "dm") return;
+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 === 'help'){
- var embed = new Discord.RichEmbed()
- .setAuthor('AleeBot '+ abVersion +' Commands', "https://cdn.discordapp.com/avatars/282547024547545109/6c147a444ae328c38145ef1f74169e38.png?size=2048")
- .addField('**ab:ping** Ping Pong!', true)
- .setFooter("AleeCorp Copyright 2017")
- .setColor("#1fd619")
- message.channel.sendEmbed(embed);
- }
-
- if(command === 'ping'){
- message.reply("**PONG!** :ping_pong: " + Math.round(client.ping) + " ms");
- }
-
+
+ let command = message.content.split(" ")[0];
+ command = command.slice(prefix.length);
+
+ let args = message.content.split(" ").slice(1);
+
+ if (command === 'help') {
+ var embed = new Discord.RichEmbed()
+ .setAuthor('AleeBot ' + abVersion + ' Commands', "https://cdn.discordapp.com/avatars/282547024547545109/6c147a444ae328c38145ef1f74169e38.png?size=2048")
+ .addField('**ab:ping** Ping Pong!', true)
+ .setFooter("AleeCorp Copyright 2017")
+ .setColor("#1fd619")
+ message.channel.sendEmbed(embed);
+ }
+
+ if (command === 'ping') {
+ message.reply("**PONG!** :ping_pong: " + Math.round(client.ping) + " ms");
+ }
+
+});
+client.login(config.abtoken).catch(function() {
+ console.log("[X] Login failed. Please contact Alee14#9928 or email him at alee14498@gmail.com.");
});
-client.login(config.abtoken).catch(function() {
- console.log("[X] Login failed. Please contact Alee14#9928 or email him at alee14498@gmail.com.");
-}); \ No newline at end of file
diff --git a/src/index.js b/src/index.js
index 27b7f3a..93856e3 100644
--- a/src/index.js
+++ b/src/index.js
@@ -1,35 +1,42 @@
/*********************************************
-*
-* AleeBot for Discord servers
-* Copyright (C) 2017 AleeCorp
-*
-**********************************************/
-const {app, BrowserWindow} = require('electron');
+ *
+ * AleeBot for Discord servers
+ * Copyright (C) 2017 AleeCorp
+ * License: MIT
+ *
+ **********************************************/
+const {
+ app,
+ BrowserWindow
+} = require('electron');
const path = require('path');
const url = require('url');
let win;
-function createWindow(){
- win = new BrowserWindow({width:800, height:600})
-
- win.loadURL(url.format({
- pathname: path.join(__dirname, 'setup.html'),
- protocol: 'file:',
- slashes: true
- }));
-
- win.webContents.openDevTools();
-
- win.on('closed', () => {
- win = null;
- });
- }
-
- app.on('ready', createWindow);
-
- app.on('window-all-closed', () => {
- if(process.platform !== 'darwin'){
- app.quit();
- }
- }); \ No newline at end of file
+function createWindow() {
+ win = new BrowserWindow({
+ width: 800,
+ height: 600
+ })
+
+ win.loadURL(url.format({
+ pathname: path.join(__dirname, 'setup.html'),
+ protocol: 'file:',
+ slashes: true
+ }));
+
+ win.webContents.openDevTools();
+
+ win.on('closed', () => {
+ win = null;
+ });
+}
+
+app.on('ready', createWindow);
+
+app.on('window-all-closed', () => {
+ if (process.platform !== 'darwin') {
+ app.quit();
+ }
+});
diff --git a/src/renderer.js b/src/renderer.js
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/renderer.js
diff --git a/src/setup.html b/src/setup.html
index f2e4b7b..7d47b7a 100644
--- a/src/setup.html
+++ b/src/setup.html
@@ -1,10 +1,26 @@
+<!--
+**********************************************
+*
+* AleeBot for Discord servers
+* Copyright (C) 2017 AleeCorp
+* License: MIT
+*
+**********************************************
+-->
<!DOCTYPE HTML>
<html>
- <head>
- </head>
- <body>
- <h1>Welcome to AleeBot!</h1>
- <br>
- <b>Please note that this isn't the final design for this setup</b>
- </body>
-</html> \ No newline at end of file
+
+<head>
+</head>
+
+<body>
+ <h1>Welcome to AleeBot!</h1>
+ <br>
+ <b>Please note that this isn't the final design for this setup</b>
+</body>
+<script>
+ const aleebot = require('bot.js')
+ console.log(aleebot)
+</script>
+
+</html>