robogram package¶
Submodules¶
robogram.api_telegram_bot module¶
Telegram Bot API.
- class robogram.api_telegram_bot.ChatActions(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
Enum- FIND_LOCATION = 'find_location'¶
- RECORD_AUDIO = 'record_audio'¶
- RECORD_VIDEO = 'record_video'¶
- TYPING = 'typing'¶
- UPLOAD_AUDIO = 'upload_audio'¶
- UPLOAD_DOCUMENT = 'upload_document'¶
- UPLOAD_PHOTO = 'upload_photo'¶
- UPLOAD_VIDEO = 'upload_video'¶
- class robogram.api_telegram_bot.TeleBot(token)[source]¶
Bases:
object- get_chat_ids_from_updates(offset=None, limit=None, timeout=None)[source]¶
Get a mapping of Chat ID to Chat Type/Title, based on /getUpdates response.
Example Response: {
12345: ‘[PRIVATE] User321’, -97531: ‘[CHANNEL] My Channel’,
}
- send_audio(chat_id, audio_path, duration=None, performer=None, title=None, disable_notification=None, reply_to_message_id=None, reply_markup=None)[source]¶
- send_chat_action(chat_id, action: ChatActions)[source]¶
- send_document(chat_id, document_path, caption=None, disable_notification=None, reply_to_message_id=None, reply_markup=None)[source]¶
- send_location(chat_id, latitude, longitude, disable_notification=None, reply_to_message_id=None, reply_markup=None)[source]¶
- send_message(chat_id, text, parse_mode='Markdown', disable_web_page_preview=True, disable_notification=False, reply_to_message_id=None, reply_markup=None)[source]¶
- send_photo(chat_id, photo_path, caption=None, disable_notification=None, reply_to_message_id=None, reply_markup=None)[source]¶
- send_sticker(chat_id, sticker_path, disable_notification=None, reply_to_message_id=None, reply_markup=None)[source]¶
- send_video(chat_id, video_path, duration=None, caption=None, disable_notification=None, reply_to_message_id=None, reply_markup=None)[source]¶
robogram.errors module¶
Module contents¶
Robogram¶
Minimal API Wrapper, utilizing Telegram Bot API to send messages (to a user, channel, or group).
- Sample Usage:
>>> from pprint import pprint >>> from robogram import TeleBot >>> bot = TeleBot('TOKEN') >>> me = bot.get_me() >>> pprint(me) >>> chat_id = -123456789 >>> bot.send_message(chat_id, 'Hello World!')
For full documentation and more advanced usage, please see <https://robogram.readthedocs.io>.
- copyright:
2024 by Ritvik Nag.
:license:MIT, see LICENSE for more details.
- class robogram.ChatActions(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
Enum- FIND_LOCATION = 'find_location'¶
- RECORD_AUDIO = 'record_audio'¶
- RECORD_VIDEO = 'record_video'¶
- TYPING = 'typing'¶
- UPLOAD_AUDIO = 'upload_audio'¶
- UPLOAD_DOCUMENT = 'upload_document'¶
- UPLOAD_PHOTO = 'upload_photo'¶
- UPLOAD_VIDEO = 'upload_video'¶
- class robogram.TeleBot(token)[source]¶
Bases:
object- get_chat_ids_from_updates(offset=None, limit=None, timeout=None)[source]¶
Get a mapping of Chat ID to Chat Type/Title, based on /getUpdates response.
Example Response: {
12345: ‘[PRIVATE] User321’, -97531: ‘[CHANNEL] My Channel’,
}
- send_audio(chat_id, audio_path, duration=None, performer=None, title=None, disable_notification=None, reply_to_message_id=None, reply_markup=None)[source]¶
- send_chat_action(chat_id, action: ChatActions)[source]¶
- send_document(chat_id, document_path, caption=None, disable_notification=None, reply_to_message_id=None, reply_markup=None)[source]¶
- send_location(chat_id, latitude, longitude, disable_notification=None, reply_to_message_id=None, reply_markup=None)[source]¶
- send_message(chat_id, text, parse_mode='Markdown', disable_web_page_preview=True, disable_notification=False, reply_to_message_id=None, reply_markup=None)[source]¶
- send_photo(chat_id, photo_path, caption=None, disable_notification=None, reply_to_message_id=None, reply_markup=None)[source]¶
- send_sticker(chat_id, sticker_path, disable_notification=None, reply_to_message_id=None, reply_markup=None)[source]¶
- send_video(chat_id, video_path, duration=None, caption=None, disable_notification=None, reply_to_message_id=None, reply_markup=None)[source]¶