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.1.tar.gz (6.6 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.1-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: versecbot_interface-0.4.1.tar.gz
  • Upload date:
  • Size: 6.6 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.1.tar.gz
Algorithm Hash digest
SHA256 527f9fccee153fced518a0192903c7713fec2463f29442699a302aad9aff9d55
MD5 5466a017a99a19df457c510ff8821ae8
BLAKE2b-256 3e0a9cff26814e5a45e2c54f8d4d0bdf9aa506666d2bb9dad04828950618b216

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for versecbot_interface-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d1d47e8bf09f21279227a2a41a96e4ddeae8de0df203b81e5bcae37c6c63ec3b
MD5 e19ed8176d8676042964ddca2b15c2d0
BLAKE2b-256 e27af95f4cecb4be5a23ad8242111ab613c20aa523563a8fac8cffe4fcb739f2

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