-
-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Remco
authored and
Remco
committed
Jan 17, 2016
1 parent
4e00864
commit 0b50786
Showing
12 changed files
with
235 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ npm-debug.log* | |
config.json | ||
music | ||
images | ||
runtime/databases | ||
|
||
# Runtime data | ||
pids | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
Reintroduce a timeout feature, but better. *(RC 1)* | ||
Music streaming, maybe rewrite to discord.io or discordie to make this easier. *(Proposed)* | ||
Move to MongoDB instead of Redis. *(RC 1)* | ||
Make command prefixes dynamic in their length requirement. *(Beta 5)* | ||
~~Move to MongoDB instead of Redis.~~ **(Scrapped)** | ||
Make `memes.json` update automatically with new memes from Imgflip. *(RC 2)* | ||
`++remindme`. *(RC 1)* | ||
OOTB experience improvements. *(Beta 5)* | ||
??? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,31 @@ | ||
{ | ||
"name": "DougleyBot", | ||
"version": "2.0.0-beta.5", | ||
"version": "2.0.0-gamma-1", | ||
"description": "A Discord bot", | ||
"readme": "README.md", | ||
"maintainers": ["Perpetucake"], | ||
"maintainers": [ | ||
"Perpetucake" | ||
], | ||
"author": "Remco Jongschaap (SteamingMutt@users.noreply.github.com)", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/SteamingMutt/DougleyBot2.0.git" | ||
}, | ||
"license": "GPL-3.0", | ||
"dependencies": { | ||
"discord.js": "^5.0.0", | ||
"winston": "^1.1.1", | ||
"cleverbot-node": "0.2.x", | ||
"request": "^2.61.0", | ||
"xml2js": "*", | ||
"leetspeak": "*", | ||
"imgflipper": "*", | ||
"csgo-market": "*", | ||
"unirest": "*", | ||
"youtube-node": "1.2.x", | ||
"discord.js": "hydrabolt/discord.js#0921484ef6775691f0b5fcd17623f6b08837c0a9", | ||
"forever": "*", | ||
"redis": "*" | ||
"imgflipper": "*", | ||
"leetspeak": "*", | ||
"leveldown": "^1.4.3", | ||
"levelup": "^1.3.1", | ||
"request": "^2.61.0", | ||
"unirest": "*", | ||
"winston": "^1.1.1", | ||
"xml2js": "*", | ||
"youtube-node": "1.2.x" | ||
}, | ||
"main": "DougBot.js" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
var Discord = require("discord.js"), | ||
bot = new Discord.Client(), | ||
request = require("request"), | ||
boundChannel = false, | ||
stream = false, | ||
vol = 0.25; | ||
|
||
exports.joinVoice = function(bot, message){ | ||
if (boundChannel) return; | ||
var channelToJoin = spliceArguments(message.content)[1]; | ||
for (var channel of message.channel.server.channels) { | ||
if (channel instanceof Discord.VoiceChannel) { | ||
if (!channelToJoin || channel.name === channelToJoin) { | ||
boundChannel = message.channel; | ||
bot.reply(message, `Binding to text channel <#${boundChannel.id}> and voice channel **${channel.name}** \`(${channel.id})\``); | ||
bot.joinVoiceChannel(channel); | ||
break; | ||
} | ||
} | ||
} | ||
}; | ||
|
||
exports.playMusicURL = function(bot, message){ | ||
var url = message.content.split(" ")[1]; | ||
bot.voiceConnection.playFile(url,{ | ||
volume : 0.25, | ||
stereo : true | ||
}); | ||
bot.reply(message, "Now playing " + url); | ||
bot.voiceConnection.emit("end"); | ||
bot.sendMessage("Stream has ended"); | ||
}; | ||
|
||
exports.stopPlaying = function(message){ | ||
if (!message.channel.equals(boundChannel)) return; | ||
stopped(); | ||
stream = false; | ||
}; | ||
|
||
exports.leaveVoice = function(bot, message){ | ||
if (!message.channel.equals(boundChannel)) return; | ||
if (!boundChannel) | ||
bot.sendMessage(message, "Can't leave what I'm not in!"); | ||
if (!boundChannel) return; | ||
bot.reply(message, `Unbinding from <#${boundChannel.id}> and destroying voice connection`); | ||
bot.leaveVoiceChannel(); | ||
boundChannel = false; | ||
stream = false; | ||
return; | ||
}; | ||
|
||
function spliceArguments(message, after) { | ||
after = after || 1; | ||
var rest = message.split(' '); | ||
var removed = rest.splice(0, after); | ||
return [removed.join(' '), rest.join(' ')]; | ||
} | ||
|
||
function stopped(){ | ||
if (bot.internal.voiceConnection) bot.internal.voiceConnection.stopPlaying(); | ||
boundChannel.sendMessage("Stream has ended"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
//TODO: Actually make functions here, lmao | ||
exports.checkConfig = function(){ | ||
// TODO: Finish this function :) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Lol good attention span Dougley