Created
September 3, 2017 07:44
-
-
Save MKtalk/63193ae606894f29f313bdf86360d3f2 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
# -*- coding: utf-8 -*- | |
from __future__ import (absolute_import, division, print_function, unicode_literals) | |
from bothub_client.bot import BaseBot | |
from bothub_client.messages import Message | |
from .korbit import coin_detail | |
class Bot(BaseBot): | |
def handle_message(self, event, context): | |
message = event.get('content') | |
if message == 'BTC': | |
self.send_message(coin_detail('btcusd')) | |
elif message == 'ETH': | |
self.send_message(coin_detail('ethusd')) | |
elif message == 'XRP': | |
self.send_message(coin_detail('xrpusd')) | |
else: | |
self.send_message('Plese use the Quick Replies.') | |
msg = Message(event).set_text('What kind of price do you want?') \ | |
.add_quick_reply('BTC') \ | |
.add_quick_reply('ETH') \ | |
.add_quick_reply('XRP') | |
self.send_message(msg) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment