Skip to content

Commit

Permalink
Merge pull request #4 from brussell98/Indev
Browse files Browse the repository at this point in the history
Merge Indev 1.2
  • Loading branch information
brussell98 committed Jan 30, 2016
2 parents ad8aa98 + 8c691e0 commit c506e84
Show file tree
Hide file tree
Showing 12 changed files with 1,207 additions and 579 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
*.tmp
*.env
.vscode
typings
node_modules
jsconfig.json
typings.json
.jscsrc
245 changes: 121 additions & 124 deletions BrussellBot.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# BrussellBot
# BrussellBot 1.2

An multipurpose bot for Discord using the [Discord.js](https://github.com/hydrabolt/discord.js/) unofficial API.
A multipurpose bot for Discord using the [Discord.js](https://github.com/hydrabolt/discord.js/) unofficial API.

[Website](http://brussell98.github.io/BrussellBot)
[Discord Server](https://discord.gg/0kvLlwb7slG3XCCQ)
[Get the latests version here](https://github.com/brussell98/BrussellBot/releases/latest)
[Get the latest version here](https://github.com/brussell98/BrussellBot/releases/latest)

[Wiki](https://github.com/brussell98/BrussellBot/wiki)
[Commands](https://github.com/brussell98/BrussellBot/wiki/Commands)
Expand All @@ -14,11 +14,11 @@ An multipurpose bot for Discord using the [Discord.js](https://github.com/hydrab

---

### TODO
### TO DO

- [ ] Music commands
- [ ] Audio help
- [ ] Queue song from youtube
- [ ] Queue song from YouTube
- [ ] Or pass it a webm link
- [ ] Skip
- [ ] Have pre-made playlists available
Expand Down
14 changes: 7 additions & 7 deletions bot/cleverbot.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ exports.cleverbot = function(bot, msg) {
if (text){
bot.startTyping(msg.channel);
for (var i = 0; i < msg.mentions.length; i++){
if (msg.mentions[i].id != bot.user.id) { text = text.replace("<@"+msg.mentions[i].id+">", msg.mentions[i].username); }
if (msg.mentions[i].id != bot.user.id) { text = text.replace('<@' + msg.mentions[i].id + '>', msg.mentions[i].username); }
}
Cleverbot.prepare(function() {
try {
Slave.write(text, function(resp) {
if (/\|/g.test(resp.message)) {
resp.message = resp.message.replace(/\|/g, "\\u"); //replace | with \u
resp.message = resp.message.replace(/\\u([\d\w]{4})/gi, function (match, grp) { //unescape unicode
return String.fromCharCode(parseInt(grp, 16));
resp.message = resp.message.replace(/\|/g, '\\u'); //replace | with \u
resp.message = resp.message.replace(/\\u([\d\w]{4})/gi, function(match, grp) { //unescape unicode
return String.fromCharCode(parseInt(grp, 16));
});
}
bot.sendMessage(msg, ":speech_balloon: "+ent.decodeHTML(resp.message));
bot.sendMessage(msg, '💬 ' + ent.decodeHTML(resp.message));
});
} catch(error) { bot.sendMessage(msg, ":warning: There was an error", function (erro, wMessage) { bot.deleteMessage(wMessage, {"wait": 8000}); }); }
} catch (error) { bot.sendMessage(msg, '⚠ There was an error', function(erro, wMessage) { bot.deleteMessage(wMessage, {'wait': 8000}); }); }
});
bot.stopTyping(msg.channel);
} else { bot.sendMessage(msg, "Yes?"); } //if no suffix
} else { bot.sendMessage(msg, 'Yes?'); } //if no suffix
};
760 changes: 437 additions & 323 deletions bot/commands.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion bot/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
"mal_pass": "",
"is_heroku_version": true,
"weather_api_key": "",
"osu_api_key": ""
"osu_api_key": "",
"banned_server_ids": [""]
}
13 changes: 8 additions & 5 deletions bot/games.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"with JOHN CENA",
"kappa kappa kappa",
"no waifu no laifu",
"your waifu is trash",
"your waifu is __trash__",
"Kancolle",
"with you",
"with __you__",
"node.js",
"discord.js",
"osu!",
Expand All @@ -19,7 +19,7 @@
"Sakura Swim Club",
"Sakura Spirit",
"Akiba's Trip",
"Animaaayyyy lmao",
"Animaayyy lmao",
"Ayyyy lmao",
"Jet fuel can't melt dank memes",
"with nekos",
Expand All @@ -32,6 +32,9 @@
"who is this Bot-chan?",
"world domination",
"dank memes",
"]help [command]",
"what's an anime?"
"Toshinou Kyouko",
"__]help [command]__",
"what's an anime?",
"@everyone",
"http://brussell98.github.io/BrussellBot/"
]}
210 changes: 103 additions & 107 deletions bot/mod.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions bot/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exports.cWarn = function (text) {
chalk.styles.bgYellow.close +
chalk.styles.white.open + chalk.styles.bgBlack.open +" ";
};

exports.cError = function (text) {
return chalk.styles.bgRed.open +
chalk.styles.black.open +
Expand All @@ -18,7 +18,7 @@ exports.cError = function (text) {
chalk.styles.bgRed.close +
chalk.styles.white.open + chalk.styles.bgBlack.open + " ";
};

exports.cDebug = function (text) {
return chalk.styles.bgWhite.open +
chalk.styles.black.open +
Expand Down
8 changes: 4 additions & 4 deletions bot/versioncheck.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
var request = require("request");
var version = require("../package.json").version;
var colors = require('./styles.js');
var colors = require("./styles.js");

exports.checkForUpdate = function (callback) {
exports.checkForUpdate = function(callback) {
request("https://raw.githubusercontent.com/brussell98/BrussellBot/master/package.json", function (err, response, body) {
if (err) {
console.log(colors.cWarn(" WARN ")+"Version check error: "+err);
console.log(colors.cWarn(" WARN ") + "Version check error: " + err);
return callback(null);
}
if (response.statusCode == 200) {
Expand All @@ -14,7 +14,7 @@ exports.checkForUpdate = function (callback) {
if ((version.split(".").join("")) > (latest.split(".").join(""))) { return callback("Bot is a development version (v" + version + ")"); }
return callback("BrussellBot is up-to-date (v" + version + ")");
} else {
console.log(colors.cWarn(" WARN ")+"Failed to check for new version. Status code: "+response.statusCode);
console.log(colors.cWarn(" WARN ") + "Failed to check for new version. Status code: " + response.statusCode);
return callback(null);
}
});
Expand Down
Loading

0 comments on commit c506e84

Please sign in to comment.