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 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


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

Uploaded Source

Built Distribution

ptb_easy_bot-0.1.2-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ptb-easy-bot-0.1.2.tar.gz
  • Upload date:
  • Size: 6.5 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.2.tar.gz
Algorithm Hash digest
SHA256 15fd92ccdfb761d923939b57e93530f3d6436bd7b1eb70b92b3fb4ef7e3136d2
MD5 98836a8bce7e022a1892271b7913a721
BLAKE2b-256 20d6697ffaf68e2ec8ec860bdca184c2231373311c4f43006c7ab0d94504b54b

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for ptb_easy_bot-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2b20f32cf55276cd3e0478d52d964186ae3e0d3eae6edcc0b38f278416f3370f
MD5 d245d4ab9476daf6a4309d809f371ba2
BLAKE2b-256 84e9c9f6d84f594993170930679e69080194197f1e8ed4c00ff97987b1e9afe4

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