First commit
This commit is contained in:
commit
2fa5a3dcfa
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
node_modules
|
||||||
|
*sublime*
|
||||||
|
mumblemusicbot
|
||||||
|
*.pem
|
21
LICENSE
Normal file
21
LICENSE
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) <year> <copyright holders>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
3
certconvert.sh
Executable file
3
certconvert.sh
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
|
||||||
|
openssl pkcs12 -in *.p12 -out public.pem -clcerts -nokeys
|
||||||
|
openssl pkcs12 -in *.p12 -out private.pem -nocerts -nodes
|
39
index.js
Normal file
39
index.js
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
//Mumsix, mumble music bot
|
||||||
|
var mumble = require('mumble');
|
||||||
|
var GS = require('grooveshark-streaming');
|
||||||
|
var fs = require('fs');
|
||||||
|
|
||||||
|
var options = {
|
||||||
|
key : fs.readFileSync(__dirname + '/private.pem'),
|
||||||
|
cert : fs.readFileSync(__dirname + '/public.pem')
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('Connecting');
|
||||||
|
mumble.connect('mumble://wallpiece:9648', options, function (err, res) {
|
||||||
|
if (err) throw new Error(err);
|
||||||
|
|
||||||
|
res.authenticate('MusicBot', 'yolo');
|
||||||
|
|
||||||
|
res.on('initialized', function () {
|
||||||
|
console.log('Connected!');
|
||||||
|
});
|
||||||
|
|
||||||
|
// On text message...
|
||||||
|
res.on( 'textMessage', function (data) {
|
||||||
|
if (data.message.split(' ')[0] == '/m' || data.message.split(' ')[0] == '/music') {
|
||||||
|
var command = data.message.split(' ').splice(1);
|
||||||
|
if (command[0] == 'g' || command[0] == 'grooveshark') {
|
||||||
|
grooveshark(command);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// res.on( 'voice', function (event) {
|
||||||
|
// console.log( 'Mixed voice' );
|
||||||
|
// var pcmData = event.data;
|
||||||
|
// });
|
||||||
|
});
|
||||||
|
|
||||||
|
function grooveshark() {
|
||||||
|
|
||||||
|
}
|
24
package.json
Normal file
24
package.json
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{
|
||||||
|
"name": "mumblemusicbot",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"description": "The bot to lighten that mumble channel up!",
|
||||||
|
"main": "index.js",
|
||||||
|
"dependencies": {
|
||||||
|
"grooveshark-streaming": "0.0.8",
|
||||||
|
"mumble": "0.0.2"
|
||||||
|
},
|
||||||
|
"devDependencies": {},
|
||||||
|
"scripts": {
|
||||||
|
"test": "node index test"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"mumble",
|
||||||
|
"music",
|
||||||
|
"bot",
|
||||||
|
"lounge",
|
||||||
|
"relax",
|
||||||
|
"listening"
|
||||||
|
],
|
||||||
|
"author": "Bram van der Veen",
|
||||||
|
"license": "MIT"
|
||||||
|
}
|
Reference in a new issue