Skip to main content

Versioned interface for VerSecBot and its plugins

Project description

VerSecBot Interface

This is a versioned interface for creating VerSecBot plugins.

To add a task for VerSecBot to handle, you'll need to create a plugin. The task should define a should_act function, which accepts a message and returns a boolean of whether this task should be activated. It should also define an act function, which accepts a message and performs the action.

class SmileBack(Watcher):

    @abstractmethod
    def should_act(self, message: Message) -> bool:
        return ":)" in message.content

    @abstractmethod
    def act(self, message: Message):
        await message.channel.send(":)")

You can then add the task to the hooks list in main.py. Eventually this may be automated for simple hooks, but for now it'll need to be done manually.

@client.event
async def on_ready():
    hooks.append(SmileBack())

The hook will then be evaluated for every message, and triggered when necessary.

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

versecbot_interface-0.4.2.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

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

versecbot_interface-0.4.2-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file versecbot_interface-0.4.2.tar.gz.

File metadata

  • Download URL: versecbot_interface-0.4.2.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for versecbot_interface-0.4.2.tar.gz
Algorithm Hash digest
SHA256 cc2e34b3f17ec579cf5b1941b49a58f2065f681b5bc376826d1937c7f13744dd
MD5 a47469f3fb7a9cfde81a2415c64c8be1
BLAKE2b-256 68b729b7abc834a28af194229b9e550754666a1b69351f4f5ffa18744038d4ef

See more details on using hashes here.

File details

Details for the file versecbot_interface-0.4.2-py3-none-any.whl.

File metadata

File hashes

Hashes for versecbot_interface-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 635f4706a963a9396482ab16fa13af304febb67aa980ceeb477ef4d1f56cddb7
MD5 0824a7773dee215488e91807528aa4d6
BLAKE2b-256 292bc003de4162c81d284a8770284358ab4486be9ab2fdfb1541970cce0f0935

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