Skip to content

Commit 93aa377

Browse files
committed
Add readme & pep8
1 parent da72906 commit 93aa377

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

‎README.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@ tb.polling(none_stop=False, interval=0, block=True)
181181
# getMe
182182
user = tb.get_me()
183183

184+
# getUpdates
185+
updates = tb.get_updates()
186+
updates = tb.get_updates(1234,100,20) #get_Updates(offset, limit, timeout):
187+
184188
# sendMessage
185189
tb.send_message(chatid, text)
186190

‎telebot/__init__.py‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import time
66

77
import logging
8+
89
logging.basicConfig()
910
logger = logging.getLogger('Telebot')
1011
import re
@@ -17,6 +18,7 @@
1718

1819
API_URL = r"https://api.telegram.org/"
1920

21+
2022
class TeleBot:
2123
""" This is TeleBot Class
2224
Methods:
@@ -59,7 +61,7 @@ def __init__(self, token, create_threads=True, num_threads=4):
5961
if self.__create_threads:
6062
self.worker_pool = util.ThreadPool(num_threads)
6163

62-
def get_Updates(self, offset=None,limit=None, timeout=20):
64+
def get_updates(self, offset=None, limit=None, timeout=20):
6365
"""
6466
Use this method to receive incoming updates using long polling (wiki). An Array of Update objects is returned.
6567
:param offset: Integer. Identifier of the first update to be returned.
@@ -207,7 +209,8 @@ def send_photo(self, chat_id, photo, caption=None, reply_to_message_id=None, rep
207209
return types.Message.de_json(
208210
apihelper.send_photo(self.token, chat_id, photo, caption, reply_to_message_id, reply_markup))
209211

210-
def send_audio(self, chat_id, audio, duration=None, performer=None, title=None, reply_to_message_id=None, reply_markup=None):
212+
def send_audio(self, chat_id, audio, duration=None, performer=None, title=None, reply_to_message_id=None,
213+
reply_markup=None):
211214
"""
212215
Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .mp3 format.
213216
:param chat_id:Unique identifier for the message recipient
@@ -220,7 +223,8 @@ def send_audio(self, chat_id, audio, duration=None, performer=None, title=None,
220223
:return: Message
221224
"""
222225
return types.Message.de_json(
223-
apihelper.send_audio(self.token, chat_id, audio,duration,performer,title, reply_to_message_id, reply_markup))
226+
apihelper.send_audio(self.token, chat_id, audio, duration, performer, title, reply_to_message_id,
227+
reply_markup))
224228

225229
def send_voice(self, chat_id, voice, duration=None, reply_to_message_id=None, reply_markup=None):
226230
"""
@@ -233,7 +237,7 @@ def send_voice(self, chat_id, voice, duration=None, reply_to_message_id=None, re
233237
:return: Message
234238
"""
235239
return types.Message.de_json(
236-
apihelper.send_voice(self.token, chat_id, voice, duration, reply_to_message_id,reply_markup))
240+
apihelper.send_voice(self.token, chat_id, voice, duration, reply_to_message_id, reply_markup))
237241

238242
def send_document(self, chat_id, data, reply_to_message_id=None, reply_markup=None):
239243
"""

0 commit comments

Comments
 (0)