diff --git a/README.md b/README.md index 06d992c..5dcd01b 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ * [Using web hooks](#using-web-hooks) * [Logging](#logging) * [Proxy](#proxy) + * [New in library](#new-in-library) * [F.A.Q.](#faq) * [Bot 2.0](#bot-20) * [How can I distinguish a User and a GroupChat in message.chat?](#how-can-i-distinguish-a-user-and-a-groupchat-in-messagechat) @@ -510,6 +511,10 @@ apihelper.proxy = {'https':'socks5://userproxy:password@proxy_address:port'} ``` +## New in library + +06.06.2019 - Добавленна поддержка опросов (Poll). Добавлены функции send_poll, stop_poll + ## F.A.Q. ### Bot 2.0 diff --git a/tests/my_tests.py b/tests/my_tests.py deleted file mode 100644 index 80f4abd..0000000 --- a/tests/my_tests.py +++ /dev/null @@ -1,40 +0,0 @@ -import os -from telebot import logger, logging, types, TeleBot - -try: - TOKEN = os.environ['TOKEN'] -except: - logger.error('Not variable \'TOKEN\' in environ') - exit(1) - -CHAT_ID = -1001405019571 -logger.setLevel(logging.DEBUG) - -bot = TeleBot(TOKEN) - - -@bot.message_handler(content_types=['poll']) -def po(m): - logger.debug('Give poll') - bot.send_message(m.chat.id, 'Я тоже так умею!') - m = bot.send_poll(m.chat.id, m.poll) - print(m.chat.id, m.message_id) - - -def test_send_poll(): - poll = types.Poll('Какой ты сегодня?') - poll.add('Добрый') - poll.add('Веселый') - poll.add('Грустный') - kb = types.InlineKeyboardMarkup() - kb.add(types.InlineKeyboardButton('1', url='t.me/dr_forse')) - result = bot.send_poll(CHAT_ID, poll, reply_to_message=60312, reply_markup=kb) - assert result['poll']['question'] == 'Какой ты сегодня?' - - -def test_stop_poll(): - res = bot.stop_poll(-1001405019571, 60370) - - -test_stop_poll() -bot.polling(none_stop=True, timeout=600)