Skip to content

Commit

Permalink
Turn off bitcoin command
Browse files Browse the repository at this point in the history
  • Loading branch information
Sardor Muminov committed Jul 26, 2017
1 parent 56af6a9 commit 9e693fb
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions bot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,23 @@ async def start_command(chat, match):
greeting.format(name=chat.sender['first_name']))


@bot.command(r'/bitcoin')
async def bitcoin_command(chat, match):
url = 'https://blockchain.info/ticker'
async with bot.session.get(url) as s:
info = await s.json()
usd = info['USD']
symbol = usd['symbol']
sell = usd['sell']
buy = usd['buy']
text = format_text('''
{name}, ҳозирги биткойн курси қуйидагича.
⬆️ Сотасиз: {sell}{symbol}
⬇️ Оласиз: {buy}{symbol}
''')
await chat.send_text(
text.format(name=chat.sender['first_name'], symbol=symbol, sell=sell, buy=buy))
# @bot.command(r'/bitcoin')
# async def bitcoin_command(chat, match):
# url = 'https://blockchain.info/ticker'
# async with bot.session.get(url) as s:
# info = await s.json()
# usd = info['USD']
# symbol = usd['symbol']
# sell = usd['sell']
# buy = usd['buy']
# text = format_text('''
# {name}, ҳозирги биткойн курси қуйидагича.

# ⬆️ Сотасиз: {sell}{symbol}
# ⬇️ Оласиз: {buy}{symbol}
# ''')
# await chat.send_text(
# text.format(name=chat.sender['first_name'], symbol=symbol, sell=sell, buy=buy))


@bot.command(r'/stop')
Expand Down

0 comments on commit 9e693fb

Please sign in to comment.