transports

package
v1.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Transport

type Transport interface {
	// Name should return the transport's name. This can be called before init!
	Name() string
	// Init will always be called after a transport instance is created.
	Init(
		botName string,
		fullConfig *toml.Tree,
		logger *logrus.Logger,
		eventDispatcher *events.EventDispatcher,
	)
	// Will be called once, when the bot starts, and should contain the main loop.
	Run()
	// Check whether a given nick is the transports name for the bot.
	NickIsMe(nick string) bool
	// Gets a list of channels the bot is on.
	GetChannelsOn() []string
	// Gets a list of nicks of users on the channel.
	GetNicks(channel string) []string
	// Send message in reply to sourceEvent.
	SendMessage(sourceEvent *events.EventMessage, message string)
	// Send message in reply to sourceEvent as a direct chat with the user.
	SendPrivateMessage(sourceEvent *events.EventMessage, nick, message string)
	// Send notice in reply to sourceEvent.
	SendNotice(sourceEvent *events.EventMessage, message string)
	// Send notice to all the channels the transport is on.
	SendMassNotice(message string)
}

Transport interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL