better messages

This commit is contained in:
Alex Grintsvayg 2017-03-17 11:04:58 -04:00
parent 53b3083bb1
commit 1b197b160d
2 changed files with 19 additions and 10 deletions

View file

@ -23,7 +23,7 @@ function init(rpcuser, rpcpassword) {
} }
var globalSlackParams = { var globalSlackParams = {
icon_emoji: ':money_with_wings:' icon_emoji: ':rickshutup:'
}; };
function respond(bot, data) { function respond(bot, data) {
@ -149,23 +149,29 @@ function doTip(bot, channel, tipper, words) {
function doHelp(bot, channel) { function doHelp(bot, channel) {
bot.postMessage(channel, var message =
'*USE <#C1TEEBS2Z|bot-sandbox> FOR EVERYTHING EXCEPT ACTUAL TIPPING*\n' +
'`' + command + ' help`: this message\n' + '`' + command + ' help`: this message\n' +
'`' + command + ' balance`: get your balance\n' + '`' + command + ' balance`: get your balance\n' +
'`' + command + ' deposit`: get address for deposits\n' + '`' + command + ' deposit`: get address for deposits\n' +
'`' + command + ' withdraw ADDRESS AMOUNT`: withdraw AMOUNT credits to ADDRESS\n' + '`' + command + ' withdraw ADDRESS AMOUNT`: withdraw AMOUNT credits to ADDRESS\n' +
'`' + command + ' USER AMOUNT`: send AMOUNT credits to USER\n' + '`' + command + ' USER AMOUNT`: send AMOUNT credits to USER\n';
'\n' +
'*Everyone will see what I say. Send me a Direct Message if you want to interact privately.*\n' + if (!channel.startsWith("D")) {
'If I\'m not responding in some channel, you can invite me by @mentioning me.\n' message =
, globalSlackParams); '*USE <#C1TEEBS2Z|bot-sandbox> FOR EVERYTHING EXCEPT ACTUAL TIPPING*\n' +
message +
'\n' +
'*Everyone will see what I say. Send me a Direct Message if you want to interact privately.*\n' +
'If I\'m not responding in some channel, you can invite me by @mentioning me.\n';
}
bot.postMessage(channel, message, globalSlackParams);
} }
function sendLbc(bot, channel, tipper, id, amount) { function sendLbc(bot, channel, tipper, id, amount) {
getAddress(id, function(err, address){ getAddress(id, function(err, address){
if (err){ if (err) {
bot.postMessage(channel, err.message); bot.postMessage(channel, err.message);
} }
else { else {
@ -174,7 +180,10 @@ function sendLbc(bot, channel, tipper, id, amount) {
bot.postMessage(channel, err.message); bot.postMessage(channel, err.message);
} }
else { else {
bot.postMessage(channel, 'Wubba lubba dub dub! <@' + tipper + '> tipped <@' + id + '> ' + amount + ' LBC (' + txLink(txId) + ')', globalSlackParams); var message =
'Wubba lubba dub dub! <@' + tipper + '> tipped <@' + id + '> ' + amount + ' LBC (' + txLink(txId) + '). ' +
'DM me `!tip` for tipbot instructions.'
bot.postMessage(channel, message, globalSlackParams);
} }
}); });
} }

BIN
rickshutup.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB