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 Client , COMMANDS from telegram import Bot, Update from telegram.ext import ContextTypes 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..") Handlers = { COMMANDS : { 'start' : start_command, }, } 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.run_polling()
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.0.7.tar.gz
(5.4 kB
view hashes)
Built Distribution
Close
Hashes for ptb_easy_bot-0.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41a54b84cf37a97c3a6414afcfc4dc4d32a152578e31ca4e6cd231606aa8a74b |
|
MD5 | 8853e14e17060c2eb6912c761804ab5f |
|
BLAKE2b-256 | a29875d2f534901f3989d52e1180d2ad8de12cb83892168cf7287ead634046b4 |