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
Updateryordamida soddalashtirilgan pollingMessageHandlerorqali barcha turdagi xabarlarni tutib olishUpdateobyektiga qulay kirish
📣 Hissa qo‘shish
Pull request’lar mamnuniyat bilan qabul qilinadi. Agar xatolik topsangiz — Issue qoldiring.
📄 Litsenziya
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
731ee99abb68eeb3c25bb785b0163761d798f21dc2da8fdc279c1bb1ff100d33
|
|
| MD5 |
feae70564a0a953f4e3e0031d5bccfb2
|
|
| BLAKE2b-256 |
0e310e62ca49b9ff16e0be4491dc38c812a0d370e28b99f71d983b09b0f0252b
|
File details
Details for the file nt_telegram_bot-0.1.0-py3-none-any.whl.
File metadata
- Download URL: nt_telegram_bot-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d6d3296ea3fde7c70a3ce0a7a0c42a500b9633ad50f5b73dc8bc381a4268cfa
|
|
| MD5 |
55add0c594c7f372668aa530a12aca6e
|
|
| BLAKE2b-256 |
5aea06959065475acb2d570adeb384b78e5fd96676d28a2a479dd9329b447827
|