Skip to main content

Python Telegram Bot Api Wrapper.

Project description

telegrambotapiwrapper

Python Telegram Bot API wrapper

What is telegrambotapiwrapper?

telegramapiwrapper is the simplest Telegram Bot Api wrapper for Python among existing wrappers.

Requirements

Python 3.7

Installation

pip install telegrambotapiwrapper

Getting started.

Создание бота

Вы должны создать бота и получить токен

Testing your bot's auth token

Воспользуемся методом getMe

>>> from telegrambotapiwrapper.wrapper import Api
>>> bot_api = Api(token="<paste here your token>")
>>> me = bot_api.get_me()
>>> me
User(id=123456679, is_bot=True, first_name='botbotbot', last_name=None, username='myrudatingposterbot', language_code=None)
>>> from telegrambotapiwrapper.typelib import User
>>> isinstance(me, User)
True

Sending text message

Sending audio file

Sending

Writing first bot

# firstbot.py
from telegrambotapiwrapper.wrapper import Api
from telegrambotapiwrapper.typelib import User

TOKEN = "<past_your_bot_api_token>"

bot_api = Api(token=TOKEN)
me = bot_api.get_me()
print("me: {}".format(me))
print("isinstance(me, User): {}".format(isinstance(me, User)))  # see type of result

Result:

(venv) dzmitry@mycomp:~$ python3 firstbot.py 
me: User(id=123456789, is_bot=True, first_name='myrfffrbot', last_name=None, username='myrfffrbot', language_code=None)
isinstance(me, User): True
(venv) dzmitry@mycomp:~$

Examples

Setting webhook

Sending message

Sending file

Using proxies

License

MIT License Copyright (c) 2019 Dzmitry Maliuzhenets

See LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

telegrambotapiwrapper-0.0.4.tar.gz (29.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

telegrambotapiwrapper-0.0.4-py3-none-any.whl (35.1 kB view details)

Uploaded Python 3

File details

Details for the file telegrambotapiwrapper-0.0.4.tar.gz.

File metadata

  • Download URL: telegrambotapiwrapper-0.0.4.tar.gz
  • Upload date:
  • Size: 29.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.2

File hashes

Hashes for telegrambotapiwrapper-0.0.4.tar.gz
Algorithm Hash digest
SHA256 a2aff9e0dadd79609805a232833c2584f83fad99594e6f69dd893cfa781e99de
MD5 d59fc55b8e6097a12f3093c65001ea2d
BLAKE2b-256 d23dd7569e4811eae5609b3a3440bf7722da9c3529e08129d1c1f7c622b520fa

See more details on using hashes here.

File details

Details for the file telegrambotapiwrapper-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: telegrambotapiwrapper-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 35.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.2

File hashes

Hashes for telegrambotapiwrapper-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 11d2c5c7bf8b1a10c5494b718c95306eb9e2098a83b03c9f647dd91893527ada
MD5 d9468bb98e69fa2a93a719102a029627
BLAKE2b-256 a9bf68e288dd9207766c11bbc2d8c0389892c55e7f8e84b6cacc905b77c46c04

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page