A module for create python-telegram-bot with easy and fast
Project description
Introduction
We’ve built the bot framework you’ve been waiting for!
Unlock seamless Telegram bot development with our intuitive, powerful framework. Tap into our thriving community for support and inspiration
Installing
You can install or upgrade ptb-easy-bot via
$ pip install ptb-easy-bot --upgrade
To install a pre-release, use the --pre flag in addition.
Quick Start
from Easy_Bot import update , InlineReplyMarkup , bot from Easy_Bot.ext import Client , HANDLERS , MessagesHandlers , ContextTypes , CallbackContext import asyncio import os TOKEN = os.environ.get('TOKEN') WEBHOOK_URL = os.environ.get('WEBHOOK_URL', None) PORT = int(os.environ.get('PORT', '8443')) async def main(): if WEBHOOK_URL: Bot = bot(TOKEN) await Bot.set_webhook(WEBHOOK_URL + "/" + TOKEN) async def start_command(update: update, context: ContextTypes.DEFAULT_TYPE): # await update.message.reply_text("Hello..") keyboard = [ ['test - test'], ['test 01 - https://t.me/pamod_madubashana','test 02 - test 02'], ['test 03 - inline_in_other'] ] reply_markup = InlineReplyMarkup(keyboard) await update.message.reply_text(text="hello",reply_markup=reply_markup) async def message_handle_func(update: update, context: ContextTypes.DEFAULT_TYPE): await update.message.reply_text(update.effective_message.text) Handlers = HANDLERS( commands = { 'start' : start_command, }, messages = MessagesHandlers(TEXT=message_handle_func), ) if __name__ == '__main__': loop = asyncio.get_event_loop() loop.run_until_complete(main()) app = Client(TOKEN=TOKEN,PORT=PORT,WEBHOOK_URL=WEBHOOK_URL,HANDLERS=Handlers) app.start()
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
ptb-easy-bot-0.1.4.tar.gz
(8.6 kB
view details)
Built Distribution
File details
Details for the file ptb-easy-bot-0.1.4.tar.gz
.
File metadata
- Download URL: ptb-easy-bot-0.1.4.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 976803ba41a78231f1a527c435669e4b918c03885daa40b05f475b746e601271 |
|
MD5 | bc8fc90198fa8b08d40f5232b55d2600 |
|
BLAKE2b-256 | aaa59dd447019ee0080ae8154a655da660fb7beb4b35dd55f0eb7b4ca5ab57a9 |
Provenance
File details
Details for the file ptb_easy_bot-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: ptb_easy_bot-0.1.4-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6e8e134f0e762703cca9c16631474f4281d7a64fc6df5f5fd76117b2c8af21f |
|
MD5 | f54d7bc28a8479c1ead676be251ca7a9 |
|
BLAKE2b-256 | 09f9aa7728e9218db7f4ec8585e971646bf5807005de921c624f5d362661f663 |