Skip to main content

Tgram Darg-And-Drop helper is a lib to help building DragAndDrop applications, or simply just to make bots faster

Project description

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About Project

tgram_dnd is a helper/utils library to help build Telegram Bot Drag-And-Drop application or just simply code bots faster :)

(back to top)

Built With

  • tgram (Bot API Interaction)
  • jinja2 (string templating)

(back to top)

Getting Started

Prerequisites

Installation

1. Clone From Source (Not Recommended)
    * git clone https://github.com/PythonNoob999/tgram_dnd.git
    * cd tgram_dnd
    * python3 -m pip install . -U
    * done✅

2. Installing From PIP (Recommended)
    * python3 -m pip install tgram_dnd
    * done ✅

Usage

Creating Basic EchoBot

from tgram_dnd import MessageBlock, MessageFlow, Reply
from tgram import TgBot, filters

bot = TgBot("INSERT_BOT_TOKEN")
blocks = []

# creating basic echo not
blocks.append(
    MessageBlock(
        actions=[
            Reply(
                func_name="text",
                # here are the arguments
                kwgs={
                    # {{var_name}} see vars templating for more info in the docs
                    "text": "{{from.first_name}} Said: {{text}}"
                },
            )
        ],
        filter=(
            filters.private & filters.text
        )
    )
)

flow = MessageFlow(bot, blocks=blocks)
# loading blocks
flow.load_plugin()
# running bot
bot.run()

Example :

Roadmap

  • Adding More Abstracted Methods
  • Configuration System (db_setup, strings, etc)
  • JsonToBlocks Converter

(back to top)

Contributing

Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the GPL-3 License. See LICENSE.txt for more information.

(back to top)

Contact

SpicyPneguin - telegram

(back to top)

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

tgram_dnd-0.0.2b0.tar.gz (19.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tgram_dnd-0.0.2b0-py3-none-any.whl (21.0 kB view details)

Uploaded Python 3

File details

Details for the file tgram_dnd-0.0.2b0.tar.gz.

File metadata

  • Download URL: tgram_dnd-0.0.2b0.tar.gz
  • Upload date:
  • Size: 19.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for tgram_dnd-0.0.2b0.tar.gz
Algorithm Hash digest
SHA256 4847d24c0798a9738bcfd8b1c86f45f26df763df23e9518603b29950dba8c169
MD5 72fca1b3c00169501f06bdcf9f7d925e
BLAKE2b-256 78c8adeed5c88142dbd9c998b6da21e7224afb8b130812f236b356671d1d1250

See more details on using hashes here.

File details

Details for the file tgram_dnd-0.0.2b0-py3-none-any.whl.

File metadata

  • Download URL: tgram_dnd-0.0.2b0-py3-none-any.whl
  • Upload date:
  • Size: 21.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for tgram_dnd-0.0.2b0-py3-none-any.whl
Algorithm Hash digest
SHA256 df12bae81b56f7c874b5d3a2df3b30d66b2b4b7f48a79b0beb66a92a723f054a
MD5 ccee416164b9ccdd51b63fdcd7b4602e
BLAKE2b-256 5279ba7b276f9dd1b77caf8e4084e95864263e2e3b96617ac43f1ea617a8e9bb

See more details on using hashes here.

Supported by

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