Documentation ¶
Index ¶
- type Discord
- func (d *Discord) AddReaction(msgID, reaction string) error
- func (d *Discord) Close()
- func (d *Discord) Init() error
- func (d *Discord) MessagesChannel() chan Message
- func (d *Discord) ReactionsChannel() chan Reaction
- func (d *Discord) RemoveReaction(msgID, reaction string) error
- func (d *Discord) SendMessage(msg string, asString bool) (sentMsgID string, err error)
- func (d *Discord) SendMessageWithFile(path string) (sentMsgID string, err error)
- func (d *Discord) SendStringHandler(text string) (sentMsgID string, err error)
- type Message
- type MessageSendFunc
- type MsgProvider
- type ProviderFactoryFunc
- type Reaction
- type Telegram
- func (t *Telegram) AddReaction(msgID, reaction string) error
- func (t *Telegram) Close()
- func (t *Telegram) Init() error
- func (t *Telegram) MessagesChannel() chan Message
- func (t *Telegram) ReactionsChannel() chan Reaction
- func (t *Telegram) RemoveReaction(msgID, reaction string) error
- func (t *Telegram) SendMessage(msg string, asText bool) (sentMsgID string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Discord ¶
type Discord struct { UserChannel *discordgo.Channel Token string UserID string // contains filtered or unexported fields }
Discord is a struct implementing MsgProvider interface
func (*Discord) AddReaction ¶
func (*Discord) MessagesChannel ¶
func (*Discord) ReactionsChannel ¶
func (*Discord) RemoveReaction ¶
func (*Discord) SendMessage ¶
func (*Discord) SendMessageWithFile ¶
type MessageSendFunc ¶
type MsgProvider ¶
type MsgProvider interface { Init() error Close() // MessagesChannel returns a channel with messages from other users (not bot's own) MessagesChannel() chan Message // ReactionsChannel returns a channel with reactions of other users (not bot's own) ReactionsChannel() chan Reaction // asText argument should make the message be sent as pure text, don't try to embed data SendMessage(msg string, asText bool) (sentMsgID string, err error) AddReaction(msgID, reaction string) error RemoveReaction(msgID, reaction string) error }
func CreateDiscord ¶
func CreateDiscord(conf configuration.Configuration) (MsgProvider, error)
CreateDiscord is a factory function implementing ProviderFactoryFunc signature It is used by CreateProvider
func CreateProvider ¶
func CreateProvider(config configuration.Configuration) (MsgProvider, error)
CreateProvider is a MsgProvider factory function
func CreateTelegram ¶
func CreateTelegram(config configuration.Configuration) (MsgProvider, error)
type ProviderFactoryFunc ¶
type ProviderFactoryFunc func(configuration.Configuration) (MsgProvider, error)
Every MsgProvider should have a function that implement this signature
type Telegram ¶
func (*Telegram) AddReaction ¶
NOTE: Telegram API doesn't support all emojis as reactions https://core.telegram.org/bots/api#reactiontype
func (*Telegram) MessagesChannel ¶
func (*Telegram) ReactionsChannel ¶
func (*Telegram) RemoveReaction ¶
Click to show internal directories.
Click to hide internal directories.