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

Uploaded Source

Built Distribution

ptb_easy_bot-0.0.8-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ptb-easy-bot-0.0.8.tar.gz
  • Upload date:
  • Size: 5.4 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.0.8.tar.gz
Algorithm Hash digest
SHA256 f896b4f6f34feda1cc65fb76222b237dba4b3caa5d3e555d546a62c3d3284990
MD5 1ba1386e372736b30ad1296f07599b8b
BLAKE2b-256 b220c595bf5699512471c9c195b4fb4643a7f9df8b93673eddc667fad31fa70a

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for ptb_easy_bot-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 05c05c4761881e2fa29f03566c9690969b546f41ca2c4e8ad1ef0288e79e1c51
MD5 2621f11364dafa45c05bc5951afc2d93
BLAKE2b-256 5d8ab4c0e86371ecfdbda1971671dd670cfbdfa96c359431cbe424248de90d00

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