Skip to main content

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

external-install-basic-ui-elements-2.3-sbts2018-outline-color-sbts2018 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 details)

Uploaded Source

Built Distribution

hikka_filters-0.2.0-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file hikka_filters-0.2.0.tar.gz.

File metadata

  • Download URL: hikka_filters-0.2.0.tar.gz
  • Upload date:
  • Size: 18.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for hikka_filters-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e46447e1d581fabfde8a7bafaaabb30c4627024074b1c13ba35ab569f0223736
MD5 c9da1428e1497458c63c06a9fb2a6487
BLAKE2b-256 d87b22a47bef88291276c3b05e83ad51866fc3a5dad60ac47b4f8e692cbb747d

See more details on using hashes here.

File details

Details for the file hikka_filters-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for hikka_filters-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 55374d9f3d61d3f118baf300fe99b1ea42fc32060e0e0c1f4e1a9ba05a99c5e5
MD5 4c4a0d9876976780247aa9e835903b49
BLAKE2b-256 ee5fd94d11a0340700c6387701423438a7fd5bd89fa6a2f417b0ff0eb83fcd2a

See more details on using hashes here.

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