Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. import os
  2. import time
  3. import config
  4. import telebot
  5.  
  6. bot = telebot.TeleBot(config.token)
  7.  
  8. @bot.message_handler(commands=['test'])
  9. def find_file_ids(message):
  10.     for file in os.listdir('music/'):
  11.         if file.split('.')[-1] == 'ogg':
  12.             f = open('music/'+file, 'rb')
  13.             res = bot.send_voice(message.chat.id, f)
  14.             print(file, res)
  15.         time.sleep(3)
  16.  
  17.  
  18. if __name__ == '__main__':
  19.     bot.polling(none_stop=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement