Skip to main content

A simple python telegram library

Project description

nt-telegram-bot

Oddiy va minimal telegram bot uchun Python + requests asosidagi kutubxona.

from telegram.updater import Updater
from telegram.handlers import MessageHandler
from telegram.types import Update
from config import TOKEN

nt-telegram-bot sizga hech qanday qo‘shimcha murakkabliksiz, tozalangan interfeys orqali Telegram bot yaratish imkonini beradi.

⚙️ O‘rnatish

pip install nt-telegram-bot

🚀 Boshlang‘ich foydalanish

Quyidagi kod namunasi orqali botni ishga tushiring:

from telegram.updater import Updater
from telegram.handlers import MessageHandler
from telegram.types import Update
from config import TOKEN


def handle_message(update: Update):
    message = update.message

    if message.text:
        if message.text == '/start':
            message.reply_text(
                TOKEN,
                "assalomu alaykum. ECHO BOT"
            )
        else:
            message.reply_text(TOKEN, message.text)
    elif message.contact:
        pass
    elif message.photo:
        pass
    elif message.sickter:
        pass


updater = Updater(TOKEN)
dispatcher = updater.dispatcher

dispatcher.add_handler(MessageHandler(handle_message))
updater.start_polling()

📌 Xususiyatlar

  • Updater yordamida soddalashtirilgan polling
  • MessageHandler orqali barcha turdagi xabarlarni tutib olish
  • Update obyektiga qulay kirish

📣 Hissa qo‘shish

Pull request’lar mamnuniyat bilan qabul qilinadi. Agar xatolik topsangiz — Issue qoldiring.

📄 Litsenziya

MIT

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

vohid_telegram_bot-0.1.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

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

vohid_telegram_bot-0.1.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file vohid_telegram_bot-0.1.0.tar.gz.

File metadata

  • Download URL: vohid_telegram_bot-0.1.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.0

File hashes

Hashes for vohid_telegram_bot-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3c6ea5efa48da5c2cdd287781a5901c40eaa888f8e1e9d0715d56c4daa276f0d
MD5 dec8fc2705684f8c3bc5502723fa7fa7
BLAKE2b-256 9a508fcf71794893e43f254804db11f8330f7a44ef780149f658dce547299bdf

See more details on using hashes here.

File details

Details for the file vohid_telegram_bot-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for vohid_telegram_bot-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 75b06c9bc7720756ce61c7ba97a2e44adc6257095326729760ad6fcb1cbc582c
MD5 aab9b26f9e705f8ded900fb4e86b2fc5
BLAKE2b-256 88715b21f9a610e5f4ce04e2a6cd42b44261ddcbb4e5f02804f2372ac0c74aaf

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