Slot Responses#

Slot-related responses.

class FilledTemplate(template, on_exception='return_none')[source]#

Bases: BaseResponse

Fill template with slot values. The text attribute of the template message should be a format-string: e.g. “Your username is {profile.username}”.

For the example above, if profile.username slot has value “admin”, it would return a copy of the message with the following text: “Your username is admin”.

template: AnnotatedAlias[Union[ConstResponse, BaseResponse]]#

A response to use as a template.

on_exception: Literal['keep_template', 'return_none']#

What to do if template filling fails.

  • “keep_template”: template is returned, unfilled.

  • “return_none”: an empty message is returned.

async call(ctx)[source]#

Implement this to create a custom function.

Return type:

Union[Message, dict, str]