Skip to main content

A simple pyton telegram libary

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

nt_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.

nt_telegram_bot-0.1.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nt_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.11.13

File hashes

Hashes for nt_telegram_bot-0.1.0.tar.gz
Algorithm Hash digest
SHA256 731ee99abb68eeb3c25bb785b0163761d798f21dc2da8fdc279c1bb1ff100d33
MD5 feae70564a0a953f4e3e0031d5bccfb2
BLAKE2b-256 0e310e62ca49b9ff16e0be4491dc38c812a0d370e28b99f71d983b09b0f0252b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nt_telegram_bot-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8d6d3296ea3fde7c70a3ce0a7a0c42a500b9633ad50f5b73dc8bc381a4268cfa
MD5 55add0c594c7f372668aa530a12aca6e
BLAKE2b-256 5aea06959065475acb2d570adeb384b78e5fd96676d28a2a479dd9329b447827

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