# Hikka Filters
>## Filters for updates-handlers for Telegram UserBot [Hikka](https://github.com/hikariatama/Hikka)
#
# <img width="30" height="30" src="https://img.icons8.com/external-sbts2018-outline-color-sbts2018/58/external-install-basic-ui-elements-2.3-sbts2018-outline-color-sbts2018.png" alt="external-install-basic-ui-elements-2.3-sbts2018-outline-color-sbts2018"/> Install
## Install via GitHub:
``` bash
pip3 install https://github.com/Den4ikSuperOstryyPer4ik/hikka_filters/archive/main.zip --upgrade
```
## Stable version from PyPi:
``` bash
pip3 install hikka-filters
```
>### For Windows: <s>pip3</s> > <b>pip</b>
#
# Usage
``` python
# requires: hikka-filters>=0.2.0
from .. import loader, utils
from hikka_filters import check_filters, user, chat, text, media, content_types, args
@loader.tds
class TestModule(loader.Module):
"""Test module for `hikka-filters` library"""
strings = {
"name": "TestHikkaModule"
}
@loader.watcher()
@check_filters(media)
async def media_watcher(self, message):
"""Watcher for messages with media"""
...
@loader.watcher()
@check_filters(content_types("forwarded") & text(startswith="!", endswith="cmd", lower=True))
async def forwarded_cmd_watcher(self, message):
"""Watcher for forwarded messages with text starstwith "!" and endswith "cmd" """
...
@loader.command()
@check_filters(args)
async def command(self, message):
"""Command with args: `(args = message.args = utils.get_args_raw(message))`"""
args = message.args
...
@loader.watcher()
@check_filters(chat([ID1, ID2, ID3]))
async def watcher_in_chats_with_ids(self, message):
"""Watcher for messages in chats with IDs"""
...
@loader.watcher()
@check_filters(user([ID1, ID2, ID3]))
async def watcher_for_sended_users_with_ids(self, message):
"""Watcher for users, sended message, by IDs"""
...
```
>## File hikka_test_module.py
#
# Thanks [@hikariatama](https://github.com/hikariatama) for making a great userbot for Telegram: [Hikka](https://hikka.pw/)!
Raw data
{
"_id": null,
"home_page": "http://github.com/Den4ikSuperOstryyPer4ik/hikka_filters",
"name": "hikka-filters",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Den4ikSuperOstryyPer4ik",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/d8/7b/22a47bef88291276c3b05e83ad51866fc3a5dad60ac47b4f8e692cbb747d/hikka_filters-0.2.0.tar.gz",
"platform": null,
"description": "# Hikka Filters\r\n\r\n>## Filters for updates-handlers for Telegram UserBot [Hikka](https://github.com/hikariatama/Hikka)\r\n#\r\n# <img width=\"30\" height=\"30\" src=\"https://img.icons8.com/external-sbts2018-outline-color-sbts2018/58/external-install-basic-ui-elements-2.3-sbts2018-outline-color-sbts2018.png\" alt=\"external-install-basic-ui-elements-2.3-sbts2018-outline-color-sbts2018\"/> Install\r\n\r\n## Install via GitHub:\r\n``` bash\r\npip3 install https://github.com/Den4ikSuperOstryyPer4ik/hikka_filters/archive/main.zip --upgrade\r\n```\r\n\r\n## Stable version from PyPi:\r\n``` bash\r\npip3 install hikka-filters\r\n```\r\n>### For Windows: <s>pip3</s> > <b>pip</b>\r\n#\r\n# Usage\r\n``` python\r\n# requires: hikka-filters>=0.2.0\r\n\r\nfrom .. import loader, utils\r\nfrom hikka_filters import check_filters, user, chat, text, media, content_types, args\r\n\r\n@loader.tds\r\nclass TestModule(loader.Module):\r\n \"\"\"Test module for `hikka-filters` library\"\"\"\r\n\r\n strings = {\r\n \"name\": \"TestHikkaModule\"\r\n }\r\n\r\n @loader.watcher()\r\n @check_filters(media)\r\n async def media_watcher(self, message):\r\n \"\"\"Watcher for messages with media\"\"\"\r\n ...\r\n \r\n @loader.watcher()\r\n @check_filters(content_types(\"forwarded\") & text(startswith=\"!\", endswith=\"cmd\", lower=True))\r\n async def forwarded_cmd_watcher(self, message):\r\n \"\"\"Watcher for forwarded messages with text starstwith \"!\" and endswith \"cmd\" \"\"\"\r\n ...\r\n \r\n @loader.command()\r\n @check_filters(args)\r\n async def command(self, message):\r\n \"\"\"Command with args: `(args = message.args = utils.get_args_raw(message))`\"\"\"\r\n args = message.args\r\n ...\r\n \r\n @loader.watcher()\r\n @check_filters(chat([ID1, ID2, ID3]))\r\n async def watcher_in_chats_with_ids(self, message):\r\n \"\"\"Watcher for messages in chats with IDs\"\"\"\r\n ...\r\n \r\n @loader.watcher()\r\n @check_filters(user([ID1, ID2, ID3]))\r\n async def watcher_for_sended_users_with_ids(self, message):\r\n \"\"\"Watcher for users, sended message, by IDs\"\"\"\r\n ...\r\n```\r\n>## File hikka_test_module.py\r\n#\r\n# Thanks [@hikariatama](https://github.com/hikariatama) for making a great userbot for Telegram: [Hikka](https://hikka.pw/)!\r\n",
"bugtrack_url": null,
"license": "GNU AGPLv3",
"summary": "Filters for updates-handlers for Telegram UserBot `Hikka` (https://github.com/hikariatama/Hikka)",
"version": "0.2.0",
"project_urls": {
"Download": "http://github.com/Den4ikSuperOstryyPer4ik/hikka_filters/releases/latest",
"Homepage": "http://github.com/Den4ikSuperOstryyPer4ik/hikka_filters"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ee5fd94d11a0340700c6387701423438a7fd5bd89fa6a2f417b0ff0eb83fcd2a",
"md5": "4c4a0d9876976780247aa9e835903b49",
"sha256": "55374d9f3d61d3f118baf300fe99b1ea42fc32060e0e0c1f4e1a9ba05a99c5e5"
},
"downloads": -1,
"filename": "hikka_filters-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4c4a0d9876976780247aa9e835903b49",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 18446,
"upload_time": "2023-06-13T08:24:34",
"upload_time_iso_8601": "2023-06-13T08:24:34.697004Z",
"url": "https://files.pythonhosted.org/packages/ee/5f/d94d11a0340700c6387701423438a7fd5bd89fa6a2f417b0ff0eb83fcd2a/hikka_filters-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d87b22a47bef88291276c3b05e83ad51866fc3a5dad60ac47b4f8e692cbb747d",
"md5": "c9da1428e1497458c63c06a9fb2a6487",
"sha256": "e46447e1d581fabfde8a7bafaaabb30c4627024074b1c13ba35ab569f0223736"
},
"downloads": -1,
"filename": "hikka_filters-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "c9da1428e1497458c63c06a9fb2a6487",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 18332,
"upload_time": "2023-06-13T08:24:36",
"upload_time_iso_8601": "2023-06-13T08:24:36.739844Z",
"url": "https://files.pythonhosted.org/packages/d8/7b/22a47bef88291276c3b05e83ad51866fc3a5dad60ac47b4f8e692cbb747d/hikka_filters-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-13 08:24:36",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Den4ikSuperOstryyPer4ik",
"github_project": "hikka_filters",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "hikka-filters"
}