From c4283fd9d484d96cdc59c9a3ab365b18618fcc9b Mon Sep 17 00:00:00 2001 From: Niko Storni Date: Tue, 30 Aug 2016 22:05:49 +0200 Subject: [PATCH 1/2] workaround for missing api --- bots/tipbot.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bots/tipbot.js b/bots/tipbot.js index 55b3785..f503b03 100644 --- a/bots/tipbot.js +++ b/bots/tipbot.js @@ -43,7 +43,9 @@ function respond(bot, data) { var subcommand = words.length >= 2 ? words[1] : 'help'; var isAllowedTip = false; - if ((!tipper.is_admin || !tipper.is_owner) && channel.name !== 'bot-sandbox' ){ + + //uncomment the next block when the new lower-level API is added (is_admin and is_owner must be included in the data dump) + if (/*(!tipper.is_admin || !tipper.is_owner) && */(channel.name !== 'C1TEEBS2Z' && !channel.name.startsWith("D") )){ //to check if the command is a tip (hence allowed to pass through) we need to check against all the other commands) if (subcommand === 'help' || subcommand === 'balance' || subcommand === 'deposit' || subcommand === 'withdraw'){ bot.postMessage(channel, 'Please help keep the channel clean: use #bot-sandbox', globalSlackParams); From 4e709db0e443970f8a419669c0d1f6ddf9a6803a Mon Sep 17 00:00:00 2001 From: Niko Storni Date: Wed, 31 Aug 2016 02:13:32 +0200 Subject: [PATCH 2/2] fixed channel not showing up --- bots/tipbot.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bots/tipbot.js b/bots/tipbot.js index ad3196f..a5ba899 100644 --- a/bots/tipbot.js +++ b/bots/tipbot.js @@ -150,7 +150,7 @@ function doTip(bot, channel, tipper, words) { function doHelp(bot, channel) { bot.postMessage(channel, - '*USE <#bot-sandbox> FOR EVERYTHING EXCEPT ACTUAL TIPPING*\n' + + '*USE <#C1TEEBS2Z|bot-sandbox> FOR EVERYTHING EXCEPT ACTUAL TIPPING*\n' + '`' + command + ' help`: this message\n' + '`' + command + ' balance`: get your balance\n' + '`' + command + ' deposit`: get address for deposits\n' +