TeleBot
content_type может быть видов
text, audio, document, photo, sticker, video, video_note, voice, location, contact, new_chat_members, left_chat_member, new_chat_title, new_chat_photo, delete_chat_photo, group_chat_created, supergroup_chat_created, channel_chat_created, migrate_to_chat_id, migrate_from_chat_id, pinned_message
@bot.message_handler(filters)
filters - content_types , commands
Примеры:
@bot.message_handler(commands=['start', 'help'])
def handle_start_help(message):
pass
@bot.message_handler(content_types=['document', 'audio'])
def handle_docs_audio(message):
pass
--------------------------
bot.polling(none_stop=False, interval=0, timeout=20) - обновление
# getUpdates
updates = tb.get_updates()
updates = tb.get_updates(1234,100,20) #get_Updates(offset, limit, timeout):
# sendMessage Написать сообщение
tb.send_message(chatid, text)
# forwardMessage Переслать сообщение
tb.forward_message(to_chat_id, from_chat_id, message_id)
# sendSticker Отправить стикер
tb.send_sticker(chat_id, sti)
tb.send_sticker(chat_id, "FILEID")
---------------------------
Клавиатура
# Using the ReplyKeyboardMarkup class
# It's constructor can take the following optional arguments: