Created
August 7, 2016 10:53
-
-
Save victoryforphil/1b099e33380978ad8b5754730823a75d to your computer and use it in GitHub Desktop.
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
var DisnodeBot = require("../src/Disnode.js"); | |
var testBot = new DisnodeBot("", "./TestBotConfig.json"); / | |
var botCommands = {}; | |
testBot.on("Bot_Ready", function(){ | |
console.log('[TEST_BOT - BotReady] Bot Ready.'); | |
testBot.loadConfig(OnLoad); | |
}); | |
var OnLoad = function(){ | |
testBot.addManager({name:"CommandHandler", options:{prefix: "!"}}); | |
testBot.addManager({name:"MusicManager", options:{voiceEvents: true, maxVolume:2.0}}); | |
testBot.addManager({name:"HelpManager", options:{}}); | |
testBot.addManager({name:"CleverManager", options:{channelid:"185614233168248833"}}); | |
testBot.addManager({name:"Wolfram", options:{key:""}}); | |
testBot.addManager({name:"DiscordManager", options:{}}); | |
testBot.addManager({name:"SayManager", options:{}}); | |
testBot.CommandHandler.AddContext(botCommands,"TestBot"); | |
testBot.CommandHandler.LoadList(testBot.config.commands); | |
} | |
testBot.on("Bot_Init", function () { //event emitter that is called before bot ready | |
console.log("[TEST_BOT - BotReady] Bot Init."); | |
}); | |
testBot.on("Bot_RawMessage", function(msg){ //event emitter called when the bot obtains a message | |
console.log("[TEST_BOT - RawMessage] |" + msg.author.name + " :: " + msg.content); | |
}); | |
//export a function that starts the bot. this allows you to have a script that launches more than one Disnode Bot | |
exports.Start = function () { | |
testBot.startBot(); | |
}; | |
//this adds a function to the botCommands to be referenced in local context when creating commands | |
botCommands.cmdDebug = function(ParsedMsg){ | |
testBot.AudioPlayer.playStream({},ParsedMsg, function(){}) | |
}``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment