Module trappedbot.responses.response

Free text responses by the bot

Expand source code
"""Free text responses by the bot"""

import re
import typing


class Response(typing.NamedTuple):
    """If an incoming message matches the .regex, respond with the .message"""

    regex: re.Pattern
    message: str

Classes

class Response (regex: re.Pattern, message: str)

If an incoming message matches the .regex, respond with the .message

Expand source code
class Response(typing.NamedTuple):
    """If an incoming message matches the .regex, respond with the .message"""

    regex: re.Pattern
    message: str

Ancestors

  • builtins.tuple

Instance variables

var message : str

Alias for field number 1

var regex : re.Pattern

Alias for field number 0