class

Autobot::Channels::Channel

Inherits Reference < Object

Abstract base class for chat channel integrations.

Each channel (Telegram, Slack, etc.) should inherit from this class and implement the start, stop, and send_message methods.

Constants

Log = ::Log.for("channels")
REPLY_CONTEXT_MAX_LENGTH = 500

Constructors

new(name : String, bus : Bus::MessageBus, allow_from : Array(String) = [] of String)
Source

Instance methods

allowed?(sender_id : String) : Bool

Check if a sender is allowed to use this bot. Returns false if no allow list (deny by default). Use ["*"] in allow_from to allow all senders.

Source
name
Source
running?
Source
send_message(message : Bus::OutboundMessage) : Nil

Send an outbound message through this channel.

Source
start

Start the channel and begin listening for messages.

Source
stop

Stop the channel and clean up resources.

Source