Advertisement
Guest User

Untitled

a guest
Feb 17th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.25 KB | None | 0 0
  1. from telegram.ext import Updater, CommandHandler
  2. import logging
  3.  
  4. logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO)
  5.  
  6. botToken = '542103062:AAGB1_w0PzoUxV-CEbuW1-LNa7xh0MuNGVo'
  7. chat_id = '-265229937'
  8.  
  9. updater = Updater(token=botToken)
  10. dispatcher = updater.dispatcher
  11.  
  12. def start(bot, updater):
  13.     bot.sendMessage(chat_id=chat_id, text='CHALLO BLYAT!!')
  14.  
  15. def noice_gif(bot, update):
  16.     # bot.sendDocument(chat_id=chat_id, document=open('/Users/mhuellmann/Downloads/click_noice.gif'))
  17.     bot.sendDocument(chat_id=chat_id, document='https://media.giphy.com/media/8vXgoDptHLniyP2RVQ/giphy.gif')
  18.  
  19. def noice_voice(bot, update):
  20.     bot.send_voice(chat_id=chat_id, voice=open('noice.mp3', 'rb'))
  21.  
  22. def noice(bot, update):
  23.     bot.sendPhoto(chat_id=chat_id, photo='https://i.ytimg.com/vi/MYuq7Xc5A4E/maxresdefault.jpg')
  24.  
  25.  
  26. start_handler = CommandHandler('start', start)
  27. noice_gif_handler = CommandHandler('noicegif', noice_gif)
  28. voice_handler = CommandHandler('voice', noice_voice)
  29. noice_handler  = CommandHandler('noice', noice)
  30.  
  31. dispatcher.add_handler(start_handler)
  32. dispatcher.add_handler(noice_gif_handler)
  33. dispatcher.add_handler(voice_handler)
  34. dispatcher.add_handler(noice_handler)
  35.  
  36. updater.start_polling()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement