Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import time
- import config
- import telebot
- bot = telebot.TeleBot(config.token)
- @bot.message_handler(commands=['test'])
- def find_file_ids(message):
- for file in os.listdir('music/'):
- if file.split('.')[-1] == 'ogg':
- f = open('music/'+file, 'rb')
- res = bot.send_voice(message.chat.id, f)
- print(file, res)
- time.sleep(3)
- if __name__ == '__main__':
- bot.polling(none_stop=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement