telebot_wrapper


Nametelebot_wrapper JSON
Version 0.2.0 PyPI version JSON
download
home_pagehttps://github.com/HamletSargsyan/pyTelegramBotApiWrapper
SummarypyTelegramBotApi wrapper
upload_time2024-07-08 08:51:22
maintainerNone
docs_urlNone
authorHamlet
requires_python<4.0,>=3.8
licenseMIT
keywords telegram bot api tools
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pyTelegramBotWrapper

![PyPI - Python Version](https://img.shields.io/pypi/pyversions/telebot_wrapper)
![GitHub Release](https://img.shields.io/github/v/release/HamletSargsyan/pyTelegramBotAPIWrapper)
![PyPI - Version](https://img.shields.io/pypi/v/pyTelegramBotApiWrapper)
![GitHub License](https://img.shields.io/github/license/HamletSargsyan/pyTelegramBotApiWrapper)


## Install

```bash
pip install --upgrade telebot_wrapper
```

## Examples

### Callback query
```python
from telebot.types import CallbackQuery,  Message
from telebot.util import quick_markup

from telebot_wrapper.utils import compress_string, decompress_string

TOKEN = ""
bot = Bot(token=TOKEN)


@bot.callback_query_handler(lambda call: decompress_string(call.data) == "any")
def handle_callback_query(call: CallbackQuery, parsed_data: list[str]):
    print("ANY")
    bot.send_message(call.message.chat.id, f"Any | Parsed data: {parsed_data}")

@bot.callback_query_handler(lambda call: True)
def callback_query(call: CallbackQuery, parsed_data: list[str]):
    print("default")
    bot.send_message(call.message.chat.id, f"Parsed data: {parsed_data}")
    
    
        
@bot.message_handler(func=lambda message: True)
def message_handler(message: Message):
    markup = quick_markup({
        "btn": {"callback_data": compress_string("any")}
    })
    
    bot.reply_to(message, "txt", reply_markup=markup)

if __name__ == "__main__":
    bot.infinity_polling()
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/HamletSargsyan/pyTelegramBotApiWrapper",
    "name": "telebot_wrapper",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": "telegram, bot, api, tools",
    "author": "Hamlet",
    "author_email": "hamlets849@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/89/48/cbbbb73ee79b060529ec9b208909462874d17e1a3f70720f498120b8dee5/telebot_wrapper-0.2.0.tar.gz",
    "platform": null,
    "description": "# pyTelegramBotWrapper\n\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/telebot_wrapper)\n![GitHub Release](https://img.shields.io/github/v/release/HamletSargsyan/pyTelegramBotAPIWrapper)\n![PyPI - Version](https://img.shields.io/pypi/v/pyTelegramBotApiWrapper)\n![GitHub License](https://img.shields.io/github/license/HamletSargsyan/pyTelegramBotApiWrapper)\n\n\n## Install\n\n```bash\npip install --upgrade telebot_wrapper\n```\n\n## Examples\n\n### Callback query\n```python\nfrom telebot.types import CallbackQuery,  Message\nfrom telebot.util import quick_markup\n\nfrom telebot_wrapper.utils import compress_string, decompress_string\n\nTOKEN = \"\"\nbot = Bot(token=TOKEN)\n\n\n@bot.callback_query_handler(lambda call: decompress_string(call.data) == \"any\")\ndef handle_callback_query(call: CallbackQuery, parsed_data: list[str]):\n    print(\"ANY\")\n    bot.send_message(call.message.chat.id, f\"Any | Parsed data: {parsed_data}\")\n\n@bot.callback_query_handler(lambda call: True)\ndef callback_query(call: CallbackQuery, parsed_data: list[str]):\n    print(\"default\")\n    bot.send_message(call.message.chat.id, f\"Parsed data: {parsed_data}\")\n    \n    \n        \n@bot.message_handler(func=lambda message: True)\ndef message_handler(message: Message):\n    markup = quick_markup({\n        \"btn\": {\"callback_data\": compress_string(\"any\")}\n    })\n    \n    bot.reply_to(message, \"txt\", reply_markup=markup)\n\nif __name__ == \"__main__\":\n    bot.infinity_polling()\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "pyTelegramBotApi wrapper",
    "version": "0.2.0",
    "project_urls": {
        "Homepage": "https://github.com/HamletSargsyan/pyTelegramBotApiWrapper",
        "Repository": "https://github.com/HamletSargsyan/pyTelegramBotApiWrapper"
    },
    "split_keywords": [
        "telegram",
        " bot",
        " api",
        " tools"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "446457154db71578d68a25e2e2cebc7900be6f9d9cb20c5e5cbd37039f1b9196",
                "md5": "f3ee31f710e8e1c1d60a867985f9ee95",
                "sha256": "0eda8e9003def95638faf7858be0dd1e93573389b162e78f70d853f10fea3fe4"
            },
            "downloads": -1,
            "filename": "telebot_wrapper-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f3ee31f710e8e1c1d60a867985f9ee95",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 3513,
            "upload_time": "2024-07-08T08:51:21",
            "upload_time_iso_8601": "2024-07-08T08:51:21.320458Z",
            "url": "https://files.pythonhosted.org/packages/44/64/57154db71578d68a25e2e2cebc7900be6f9d9cb20c5e5cbd37039f1b9196/telebot_wrapper-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8948cbbbb73ee79b060529ec9b208909462874d17e1a3f70720f498120b8dee5",
                "md5": "16035bddb21b68f3a43a9eba0b612c16",
                "sha256": "b7ba936ff3e15367ce4c38f7deaa13759e4db1281e6150dde822c82a0b82e905"
            },
            "downloads": -1,
            "filename": "telebot_wrapper-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "16035bddb21b68f3a43a9eba0b612c16",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 2712,
            "upload_time": "2024-07-08T08:51:22",
            "upload_time_iso_8601": "2024-07-08T08:51:22.442870Z",
            "url": "https://files.pythonhosted.org/packages/89/48/cbbbb73ee79b060529ec9b208909462874d17e1a3f70720f498120b8dee5/telebot_wrapper-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-08 08:51:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "HamletSargsyan",
    "github_project": "pyTelegramBotApiWrapper",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "telebot_wrapper"
}
        
Elapsed time: 0.84563s