Filters for updates-handlers for Telegram UserBot `Hikka` (https://github.com/hikariatama/Hikka)
Project description
Hikka Filters
Filters for updates-handlers for Telegram UserBot Hikka
Install
Install via GitHub:
pip3 install https://github.com/Den4ikSuperOstryyPer4ik/hikka_filters/archive/main.zip --upgrade
Stable version from PyPi:
pip3 install hikka-filters
For Windows:
pip3> pip
Usage
# 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 for making a great userbot for Telegram: Hikka!
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
hikka_filters-0.2.0.tar.gz
(18.3 kB
view hashes)
Built Distribution
Close
Hashes for hikka_filters-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55374d9f3d61d3f118baf300fe99b1ea42fc32060e0e0c1f4e1a9ba05a99c5e5 |
|
MD5 | 4c4a0d9876976780247aa9e835903b49 |
|
BLAKE2b-256 | ee5fd94d11a0340700c6387701423438a7fd5bd89fa6a2f417b0ff0eb83fcd2a |