Skip to main content

Lightweight telegram bot library.

Project description

TBot

Lightweight telegram bot library for python.


"""example.py"""
from TBot import TBot

BOT = TBot("<token>")
BOT.update_frequence = 0.5  # seconds


@BOT.command("/help")
def help_command(event):
    """Help command handler"""
    BOT.send(event, "Help Message")


@BOT.command("/chat")
def chat(event):
    """Send chat id"""
    group = BOT.get_chat(event)
    if group:
        args = ["title", "type", "id"]
        message = ""
        for i in args:
            message += i.capitalize() + ': ' + str(getattr(group, i)) + "\n"
        BOT.send(event, message)


@BOT.command("*")
def generic(event):
    """Generic command fallback"""
    BOT.send(event, "You said: " + event.text)


BOT.run()

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

Alby7503TBot-1.0.9.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

Alby7503TBot-1.0.9-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file Alby7503TBot-1.0.9.tar.gz.

File metadata

  • Download URL: Alby7503TBot-1.0.9.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/50.0.3 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for Alby7503TBot-1.0.9.tar.gz
Algorithm Hash digest
SHA256 cbe6ec1bec30509494f7b8f1bed1cdf9d5fdd74c601d92de6a02e26155aaffc8
MD5 0dd29f63e5a9b4a1e7df53466367ff0e
BLAKE2b-256 fac96a9417995c2ee30d63b0bf13f2c575dd88e52175f80743c38f6b3e4549ea

See more details on using hashes here.

File details

Details for the file Alby7503TBot-1.0.9-py3-none-any.whl.

File metadata

  • Download URL: Alby7503TBot-1.0.9-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/50.0.3 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for Alby7503TBot-1.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 5f59242099fe4b6a47a80c296f22b8e9696261fd80a5769f9cc8f1f3a5e3c481
MD5 1731376cb5b76b7e831ed75149934b57
BLAKE2b-256 73bdfdf0250feb20bf092853f86dae3808173956e0d42cd87133dacae33190c5

See more details on using hashes here.

Supported by

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