Documentation ¶
Index ¶
- Variables
- func ChannelMessageSend(channelId string, message string) error
- func RegisterCatchallExtendeHandler(h CatchallExtendedHandler)
- func RegisterCatchallHandler(h CatchallHandler)
- func RegisterImageHandler(h ImageHandler)
- func RegisterMessageHandler(m string, h MessageHandler)
- func RegisterMessagePlatform(m MessagePlatform)
- func RegisterMessageWithInputHandler(m string, h MessageWithInputHandler)
- func RegisterPassiveMessagePlatform(m MessagePlatform)
- func Shutdown()
- type AddMessagePlatform
- type CatchallExtendedHandler
- type CatchallHandler
- type DiscordMessagePlatform
- func (s *DiscordMessagePlatform) ChannelMessageSend(channel, message string) error
- func (dg *DiscordMessagePlatform) Close()
- func (dg *DiscordMessagePlatform) ProcessMessages()
- func (dg *DiscordMessagePlatform) Send(text string)
- func (dg *DiscordMessagePlatform) SendWithOptions(text string, options SendOptions)
- type ExtendedMessage
- type ImageHandler
- type IrcMessagePlatform
- type MessageHandler
- type MessagePlatform
- type MessageWithInputHandler
- type ReadlineMessagePlatform
- func (s *ReadlineMessagePlatform) ChannelMessageSend(channelId, message string) error
- func (s *ReadlineMessagePlatform) Close()
- func (s *ReadlineMessagePlatform) ProcessMessages()
- func (s *ReadlineMessagePlatform) Send(text string)
- func (s *ReadlineMessagePlatform) SendWithOptions(text string, options SendOptions)
- type Request
- type SendOptions
- type SlackMessagePlatform
- type TelegramMessagePlatform
- func (s *TelegramMessagePlatform) ChannelMessageSend(channel, message string) error
- func (s *TelegramMessagePlatform) ChannelMessageSilentSend(channel, message string) error
- func (s *TelegramMessagePlatform) Close()
- func (s *TelegramMessagePlatform) ProcessMessages()
- func (s *TelegramMessagePlatform) Send(text string)
- func (s *TelegramMessagePlatform) SendWithOptions(text string, options SendOptions)
Constants ¶
This section is empty.
Variables ¶
View Source
var ActiveMessagePlatforms = []MessagePlatform{}
View Source
var AddMessagePlatforms = []AddMessagePlatform{}
View Source
var CatchallExtendedHandlers = []CatchallExtendedHandler{}
View Source
var CatchallHandlers = []CatchallHandler{}
View Source
var Handlers = map[string]MessageHandler{}
View Source
var ImageHandlers = []ImageHandler{}
View Source
var MsgInputHandlers = map[string]MessageWithInputHandler{}
Functions ¶
func ChannelMessageSend ¶
func RegisterCatchallExtendeHandler ¶
func RegisterCatchallExtendeHandler(h CatchallExtendedHandler)
func RegisterCatchallHandler ¶
func RegisterCatchallHandler(h CatchallHandler)
func RegisterImageHandler ¶
func RegisterImageHandler(h ImageHandler)
func RegisterMessageHandler ¶
func RegisterMessageHandler(m string, h MessageHandler)
func RegisterMessagePlatform ¶
func RegisterMessagePlatform(m MessagePlatform)
func RegisterMessageWithInputHandler ¶
func RegisterMessageWithInputHandler(m string, h MessageWithInputHandler)
func RegisterPassiveMessagePlatform ¶
func RegisterPassiveMessagePlatform(m MessagePlatform)
Types ¶
type AddMessagePlatform ¶
type AddMessagePlatform func(MessagePlatform)
type CatchallExtendedHandler ¶
type CatchallExtendedHandler func(ExtendedMessage) *ExtendedMessage
type CatchallHandler ¶
type DiscordMessagePlatform ¶
type DiscordMessagePlatform struct { Session *discordgo.Session Channels map[string]string Me *discordgo.User }
Implements MessagePlatform
func NewMessagePlatformFromDiscord ¶
func NewMessagePlatformFromDiscord(discordtoken string) (*DiscordMessagePlatform, error)
func (*DiscordMessagePlatform) ChannelMessageSend ¶
func (s *DiscordMessagePlatform) ChannelMessageSend(channel, message string) error
func (*DiscordMessagePlatform) Close ¶
func (dg *DiscordMessagePlatform) Close()
func (*DiscordMessagePlatform) ProcessMessages ¶
func (dg *DiscordMessagePlatform) ProcessMessages()
func (*DiscordMessagePlatform) Send ¶
func (dg *DiscordMessagePlatform) Send(text string)
Send to default channel
func (*DiscordMessagePlatform) SendWithOptions ¶
func (dg *DiscordMessagePlatform) SendWithOptions(text string, options SendOptions)
type ExtendedMessage ¶
type ImageHandler ¶
type IrcMessagePlatform ¶
type IrcMessagePlatform struct { Conn *tls.Conn Signal chan os.Signal ClientConfig *irc.ClientConfig Client *irc.Client DefaultChannel string CloseMe bool // contains filtered or unexported fields }
Implements MessagePlatform
func NewMessagePlatformFromIrc ¶
func NewMessagePlatformFromIrc(serveraddr string, clientconfig *irc.ClientConfig, signal chan os.Signal) (*IrcMessagePlatform, error)
func (*IrcMessagePlatform) ChannelMessageSend ¶
func (s *IrcMessagePlatform) ChannelMessageSend(channelId, message string) error
func (*IrcMessagePlatform) Close ¶
func (s *IrcMessagePlatform) Close()
func (*IrcMessagePlatform) ProcessMessages ¶
func (s *IrcMessagePlatform) ProcessMessages()
func (*IrcMessagePlatform) Send ¶
func (s *IrcMessagePlatform) Send(text string)
func (*IrcMessagePlatform) SendWithOptions ¶
func (s *IrcMessagePlatform) SendWithOptions(text string, options SendOptions)
type MessageHandler ¶
type MessageHandler func() string
type MessagePlatform ¶
type MessageWithInputHandler ¶
type ReadlineMessagePlatform ¶
Implements MessagePlatform
func NewMessagePlatformFromReadline ¶
func NewMessagePlatformFromReadline(historyfile string, signal chan os.Signal) (*ReadlineMessagePlatform, error)
func (*ReadlineMessagePlatform) ChannelMessageSend ¶
func (s *ReadlineMessagePlatform) ChannelMessageSend(channelId, message string) error
func (*ReadlineMessagePlatform) Close ¶
func (s *ReadlineMessagePlatform) Close()
func (*ReadlineMessagePlatform) ProcessMessages ¶
func (s *ReadlineMessagePlatform) ProcessMessages()
func (*ReadlineMessagePlatform) Send ¶
func (s *ReadlineMessagePlatform) Send(text string)
func (*ReadlineMessagePlatform) SendWithOptions ¶
func (s *ReadlineMessagePlatform) SendWithOptions(text string, options SendOptions)
type SendOptions ¶
type SendOptions struct {
Silent bool
}
type SlackMessagePlatform ¶
type SlackMessagePlatform struct { Client *slack.Client SocketModeClient *socketmode.Client ChannelId map[string]string Me *slack.AuthTestResponse DefaultChannel string // contains filtered or unexported fields }
Implements MessagePlatform New way, using Slack Socket Mode
func NewMessagePlatformFromSlack ¶
func NewMessagePlatformFromSlack(slackbottoken, slackapptoken string) (*SlackMessagePlatform, error)
func (*SlackMessagePlatform) ChannelMessageSend ¶
func (s *SlackMessagePlatform) ChannelMessageSend(channel, message string) error
func (*SlackMessagePlatform) Close ¶
func (s *SlackMessagePlatform) Close()
func (*SlackMessagePlatform) ProcessMessages ¶
func (s *SlackMessagePlatform) ProcessMessages()
func (*SlackMessagePlatform) Send ¶
func (s *SlackMessagePlatform) Send(text string)
func (*SlackMessagePlatform) SendWithOptions ¶
func (s *SlackMessagePlatform) SendWithOptions(text string, options SendOptions)
type TelegramMessagePlatform ¶
type TelegramMessagePlatform struct { Client *tgbotapi.BotAPI ChannelId map[string]string KnownUsers map[string]tgbotapi.User KnownUsersLock sync.RWMutex DefaultChannel string }
Implements MessagePlatform
func NewMessagePlatformFromTelegram ¶
func NewMessagePlatformFromTelegram(telegrambottoken string) (*TelegramMessagePlatform, error)
func (*TelegramMessagePlatform) ChannelMessageSend ¶
func (s *TelegramMessagePlatform) ChannelMessageSend(channel, message string) error
func (*TelegramMessagePlatform) ChannelMessageSilentSend ¶
func (s *TelegramMessagePlatform) ChannelMessageSilentSend(channel, message string) error
ChannelMessageSilentSend is FIXME: dupe of ChannelMessageSend with DisableNotification
func (*TelegramMessagePlatform) Close ¶
func (s *TelegramMessagePlatform) Close()
func (*TelegramMessagePlatform) ProcessMessages ¶
func (s *TelegramMessagePlatform) ProcessMessages()
func (*TelegramMessagePlatform) Send ¶
func (s *TelegramMessagePlatform) Send(text string)
func (*TelegramMessagePlatform) SendWithOptions ¶
func (s *TelegramMessagePlatform) SendWithOptions(text string, options SendOptions)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.