Types#
Various types and constants used throughout Clicky.
Misc.#
- class clicky.types.ReplyType(value)#
The type of reply to send back to the user.
Backends are free to choose how to handle (or ignore) these reply types. Errors can be treated as normal messages, or they may have unique styling, for example.
- ATTACHMENT = 2#
Used for long messages like command output that should be sent as an attachment (if necessary). For example slack has a limit of ~3000 characters per message, so we cannot use it for long-form output.
- ERROR = 3#
A short message displayed when an error occurred.
- MESSAGE = 1#
Short messages displayed directly in a channel.
Configuration Types#
Types that are used to validate the configuration dictionary in IDEs.
- class clicky.types.Configuration#
- backends: NotRequired[dict[str, BackendConfig]]#
An optional mapping of backends to configure.
- maximum_command_timeout: NotRequired[int]#
Maximum time in seconds for a command to run before it’s terminated. Defaults to 5 minutes.
- whitelist: NotRequired[list[WhitelistConfig]]#
An optional whitelist to allow specific Identities to use commands based off of simple regex matching.
- class clicky.types.WhitelistConfig#
- allow: list[str]#
A list of regexes that commands must match to be allowed to run. These are checked _before_ denies. To allow all commands, simply use
.*
as your regex.
- deny: NotRequired[list[str]]#
An optional list of regexes that commands must _not_ match to be allowed to run. These are only checked it the command matched an
allow
rule first. Use this to selectively deny flags (such as--force
) or subcommands (such asdatabase deleteeverything
)
- id: str#
The unique ID for the given type of identifier.
- on: str#
The name of the backend instance this rule should apply to.
- type: str#
The type of identifier that this rule should apply to, such as a “channel” or “user”.
- class clicky.types.BackendConfig#
- backend: Literal['slack', 'discord']#
The type of backend that should be started.
- prefix: str#
A command prefix the backend should listen for, such as !clicky or @clicky.
- settings: NotRequired[dict[str, str]]#
Backend-specific settings. See the documentation for the selected backend to see the options here.