Skip to main content

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


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.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

ptb_easy_bot-0.1.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file ptb-easy-bot-0.1.0.tar.gz.

File metadata

  • Download URL: ptb-easy-bot-0.1.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.9

File hashes

Hashes for ptb-easy-bot-0.1.0.tar.gz
Algorithm Hash digest
SHA256 488b8800a85a1f4b41e52c87b33e068f2aad5345786186e8ebf19f86cc8a3460
MD5 2f2dce91be28015e5574065fbe8217f2
BLAKE2b-256 86147ee84cfa61ae2e2f5f37c807e3e34f74ea2f889d5afd6630d6b015234dd0

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for ptb_easy_bot-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c51ae32349b9586141f0fa37b34a73c4235a128e78172a3f6d8afd69842cb9c6
MD5 f2f61bf285355f99763afec99d813e23
BLAKE2b-256 23ab695259fa6e4c65588a5eeb8fd82b413a07b93ee553482cf86a1e3e46ea20

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page