Documentation
¶
Overview ¶
Package irc provides an IRC provider for omnichat.
Index ¶
- type Config
- type Provider
- func (p *Provider) Connect(ctx context.Context) error
- func (p *Provider) Disconnect(ctx context.Context) error
- func (p *Provider) IsConnected() bool
- func (p *Provider) JoinChannel(channel string) error
- func (p *Provider) Name() string
- func (p *Provider) OnEvent(handler provider.EventHandler)
- func (p *Provider) OnMessage(handler provider.MessageHandler)
- func (p *Provider) PartChannel(channel string, reason string) error
- func (p *Provider) Send(ctx context.Context, chatID string, msg provider.OutgoingMessage) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Server is the IRC server address (e.g., "irc.libera.chat:6697").
Server string
// Nick is the bot's nickname.
Nick string
// User is the username (defaults to Nick if empty).
User string
// RealName is the real name field (defaults to Nick if empty).
RealName string
// Password is the NickServ password (optional).
Password string
// Channels is the list of channels to join on connect.
Channels []string
// UseTLS enables TLS for the connection.
UseTLS bool
// Logger is the logger instance.
Logger *slog.Logger
}
Config configures the IRC provider.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements the Provider interface for IRC.
func (*Provider) Disconnect ¶
Disconnect closes the IRC connection.
func (*Provider) IsConnected ¶
IsConnected returns whether the provider is connected.
func (*Provider) JoinChannel ¶
JoinChannel joins an IRC channel.
func (*Provider) OnEvent ¶
func (p *Provider) OnEvent(handler provider.EventHandler)
OnEvent registers an event handler.
func (*Provider) OnMessage ¶
func (p *Provider) OnMessage(handler provider.MessageHandler)
OnMessage registers a message handler.
func (*Provider) PartChannel ¶
PartChannel leaves an IRC channel.
Click to show internal directories.
Click to hide internal directories.