From 2862af86c960b481ddf64ec1713e14908a366616 Mon Sep 17 00:00:00 2001 From: Roman Volosovskyi Date: Thu, 27 Apr 2017 20:42:00 +0300 Subject: [PATCH] fix demo bot --- bots/demo_bot/bot.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/bots/demo_bot/bot.js b/bots/demo_bot/bot.js index 3f5988ccfe..13d401898b 100644 --- a/bots/demo_bot/bot.js +++ b/bots/demo_bot/bot.js @@ -75,16 +75,14 @@ function superSuggestion(params, context) { status.addListener("on-message-input-change", superSuggestion); status.addListener("on-message-send", function (params, context) { if (isNaN(params.message)) { - status.sendMessage("Seems that you don't want to send money :("); - return; + return {"text-message": "Seems that you don't want to send money :("}; } var balance = web3.eth.getBalance(context.from); var value = parseFloat(params.message); var weiValue = web3.toWei(value, "ether"); if (bn(weiValue).greaterThan(bn(balance))) { - status.sendMessage("No way man, you don't have enough money! :)"); - return; + return {"text-message": "No way man, you don't have enough money! :)"}; } try { web3.eth.sendTransaction({ @@ -92,8 +90,8 @@ status.addListener("on-message-send", function (params, context) { to: context.from, value: weiValue }); - status.sendMessage("You are the hero, you sent " + value + " ETH to yourself!"); + return {"text-message": "You are the hero, you sent " + value + " ETH to yourself!"}; } catch (err) { - status.sendMessage("Something went wrong :(") + return {"text-message": "Something went wrong :("}; } });