Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Sardor Muminov committed Jul 26, 2017
1 parent 096a346 commit 62c6b25
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 55 deletions.
55 changes: 0 additions & 55 deletions bot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,61 +27,6 @@ def format_text(text):
return textwrap.dedent(text)


@bot.command(r'salom')
@bot.command(r'салом')
async def salom_command(chat, match):
greeting = format_text('''
Салом, {name}. 🖐
''')
logger.info('Got greeting from %s', chat.sender)
await chat.send_text(
greeting.format(name=chat.sender['first_name']))


@bot.command(r'/start')
async def start_command(chat, match):
greeting = format_text('''
Салом, {name}. 🖐
''')
logger.info('Got start from %s', chat.sender)
await chat.send_text(
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'/stop')
async def stop_command(chat, match):
greeting = format_text('''
{name}, мен унақа гапларни тушунмайман.
''')
logger.info('Got goodbye from %s', chat.sender)
await chat.send_text(
greeting.format(name=chat.sender['first_name']))


@bot.command(r'/gif')
async def gif_command(chat, match):
await chat.send_document(document=open('media/funny.gif', 'rb'))


@bot.handle('new_chat_member')
async def new_chat_member_event(chat, member):
logger.info('New chat member %s joined group', member['first_name'])
Expand Down
Binary file removed media/funny.gif
Binary file not shown.

0 comments on commit 62c6b25

Please sign in to comment.