Documentation
¶
Index ¶
Constants ¶
View Source
const DBSchema = `` /* 266-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func QueueMessage ¶ added in v1.4.7
func QueueMessage(elem *QueuedElement)
QueueMessage queues a message in the message queue
func RegisterPlugin ¶ added in v1.4.1
func RegisterPlugin()
RegisterPlugin registers the mqueue plugin into the plugin system and also initializes it
func RegisterSource ¶
func RegisterSource(name string, source PluginWithSourceDisabler)
RegisterSource registers a mqueue source, used for error handling
Types ¶
type Plugin ¶ added in v1.4.1
type Plugin struct {
}
Plugin represents the mqueue plugin
func (*Plugin) LateBotInit ¶ added in v1.11.5
func (p *Plugin) LateBotInit()
LateBotInit implements bot.LateBotInitHandler
func (*Plugin) PluginInfo ¶ added in v1.17.0
func (p *Plugin) PluginInfo() *common.PluginInfo
PluginInfo implements common.Plugin
type PluginWithSourceDisabler ¶ added in v1.24.6
type PluginWithSourceDisabler interface {
DisableFeed(elem *QueuedElement, err error)
}
PluginWithSourceDisabler todo
type PluginWithWebhookAvatar ¶ added in v1.16.2
type PluginWithWebhookAvatar interface {
WebhookAvatar() string
}
PluginWithWebhookAvatar can be implemented by plugins for custom avatars
type QueuedElement ¶
type QueuedElement struct {
// The channel to send the message in
Channel int64
Guild int64
ID int64
// Where this feed originated from, responsible for handling discord specific errors
Source string
// Could be stuff like reddit feed element id, youtube feed element id and so on
SourceID string
// The actual message as a simple string
// specify only one of MessageStr or MessageEmbed
MessageStr string `json:",omitempty"`
// The actual message as an embed
// specify only one of MessageStr or MessageEmbed
MessageEmbed *discordgo.MessageEmbed `json:",omitempty"`
UseWebhook bool
WebhookUsername string
AllowedMentions discordgo.AllowedMentions `json:"allowed_mentions"`
// When the queue grows, the feeds with the highest priority gets sent first
Priority int
}
QueuedElement represents a queued message
Click to show internal directories.
Click to hide internal directories.