A bot that aside from inhereting mubot's most usefull core features and scripts, allows you to host a multiple of preconfigured webservices. One of which allows you to connect directly to the bitmark network.
The main webservice is a marking implementation that uses an included back end marking API. Seperate marking implemenations (like mubots own text based markings) are not shown here but will also use the back end API.
The documentation page for the API is another webservice included and is a great place to learn how to actually enable bitmarking in your applications.
Another webservice included is a logger, which logs all servers.
1.) Nodejs
To install I recommend first installing nvm:
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
Then run this snippet every time to load nvm (or add it to your .bashrc / .bash_profile).
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
Then to download, compile, and install the latest release of node
nvm install node
And then just use the installed version:
nvm use node
git clone https://github.com/ileathan/Mubot.git
./Mubot/bin/mubot
... This project is still constantly in developement but a full guide is coming. That way each end user can host their own marking servers accompanied with a customized and extended mubot implementation.
1.) From within your Mubot directory run node
All commands from here on out are in REPL:
2.)
Mubot = require('mubot')
3.)
// These are obviously not valid anymore, replace with your own.
process.env.MUBOT_DISCORD_TOKEN="MzI5NjEyNTk2Mzk3MzQyNzIx.DDU_LA.D8jneOVTr-M_yIIfjQ-IJ9-QsAm"
process.env.MUBOT_SLACK_TOKEN="xoxb-3547094061-9j1Ujh3YhaZ7TShV7YkaHxbK"
4.)
bot = Mubot.loadBot(process.cwd()+'/node_modules/', 'discord', true, 'Mubot', 'Mubot') // (path_to_mubot, adapter_name, http_server, name, alias)
5.)
bot.loadHubotScripts(process.cwd()+'/scripts', fs.readdirSync(process.cwd()+'/scripts/'))
6.)
bot.loadExternalScripts(JSON.parse(fs.readFileSync(process.cwd()+'/external-scripts.json')))
7.)
bot.run()
At this point you should be logged in to discord with a fully functional Mubot! (1 liner for both slack and discord)
process.env.MUBOT_DISCORD_TOKEN="MzI5NjEyNTk2Mzk3MzQyNzIx.DDU_LA.D8jneOVTr-M_yIIfjQ-IJ9-QsAm"; Mubot = require('mubot'); botDiscord = Mubot.loadBot(process.cwd()+'/node_modules/', 'discord', true, 'Mubot', 'Mubot'); botDiscord.loadHubotScripts(process.cwd()+'/scripts', fs.readdirSync(process.cwd()+'/scripts/')); botDiscord.loadExternalScripts(fs.readFileSync(process.cwd()+'/external-scripts.json').toString().slice(5,-4).split("\",\n \"")); botDiscord.run(); process.env.MUBOT_SLACK_TOKEN="xoxb-3547094061-auQ8rtm6DKDXaTqGWCDaS2hl"; botSlack = Mubot.loadBot(process.cwd()+'/node_modules/', 'slack', true, 'Mubot', 'Mubot'); botSlack.loadHubotScripts(process.cwd()+'/scripts', fs.readdirSync(process.cwd()+'/scripts/')); botSlack.loadExternalScripts(JSON.parse(fs.readFileSync(process.cwd()+'/external-scripts.json'))); botSlack.run()
- with <3 from https://leat.io & https://leathan.xyz