Documentation ¶
Index ¶
- Variables
- func CheckGuildFull(gs *dstate.GuildState, fetchMembers bool)
- func CheckPresence(client radix.Client, config *Config, ms *dstate.MemberState, ...) error
- func DisableStreamingRole(guildID int64)
- func GiveStreamingRole(ms *dstate.MemberState, role int64, guild *discordgo.Guild)
- func HandleGuildCreate(evt *eventsystem.EventData)
- func HandleGuildMemberUpdate(evt *eventsystem.EventData) (retry bool, err error)
- func HandlePostStreaming(w http.ResponseWriter, r *http.Request) interface{}
- func HandlePresenceUpdate(evt *eventsystem.EventData) (retry bool, err error)
- func HandleUpdateStreaming(event *pubsub.Event)
- func KeyCurrentlyStreaming(gID int64) string
- func RegisterPlugin()
- func RemoveStreaming(client radix.Client, config *Config, guildID int64, ms *dstate.MemberState)
- func RemoveStreamingRole(ms *dstate.MemberState, role int64, guildID int64)
- func SendStreamingAnnouncement(config *Config, guild *dstate.GuildState, ms *dstate.MemberState)
- type CacheKey
- type ConextKey
- type Config
- type LegacyConfig
- type Plugin
- func (p *Plugin) BotInit()
- func (p *Plugin) InitWeb()
- func (p *Plugin) LoadServerHomeWidget(w http.ResponseWriter, r *http.Request) (web.TemplateData, error)
- func (p *Plugin) PluginInfo() *common.PluginInfo
- func (p *Plugin) ServerHomeWidgetApplyMiddlewares(inner http.Handler) http.Handler
- func (p *Plugin) ShardMigrationReceive(evt dshardorchestrator.EventType, data interface{})
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = &Config{ Enabled: false, AnnounceMessage: "OH WOWIE! **{{.User.Username}}** is currently streaming! Check it out: {{.URL}}", }
Functions ¶
func CheckGuildFull ¶
func CheckGuildFull(gs *dstate.GuildState, fetchMembers bool)
func CheckPresence ¶
func CheckPresence(client radix.Client, config *Config, ms *dstate.MemberState, gs *dstate.GuildState) error
func DisableStreamingRole ¶
func DisableStreamingRole(guildID int64)
func GiveStreamingRole ¶
func GiveStreamingRole(ms *dstate.MemberState, role int64, guild *discordgo.Guild)
func HandleGuildCreate ¶
func HandleGuildCreate(evt *eventsystem.EventData)
func HandleGuildMemberUpdate ¶
func HandleGuildMemberUpdate(evt *eventsystem.EventData) (retry bool, err error)
func HandlePostStreaming ¶
func HandlePostStreaming(w http.ResponseWriter, r *http.Request) interface{}
func HandlePresenceUpdate ¶
func HandlePresenceUpdate(evt *eventsystem.EventData) (retry bool, err error)
func KeyCurrentlyStreaming ¶
func RegisterPlugin ¶
func RegisterPlugin()
func RemoveStreaming ¶
func RemoveStreamingRole ¶
func RemoveStreamingRole(ms *dstate.MemberState, role int64, guildID int64)
func SendStreamingAnnouncement ¶
func SendStreamingAnnouncement(config *Config, guild *dstate.GuildState, ms *dstate.MemberState)
Types ¶
type Config ¶
type Config struct { Enabled bool `json:"enabled" schema:"enabled"` // Wether streaming notifications is enabled or not // Give a role to people streaming GiveRole int64 `json:"give_role,string" schema:"give_role" valid:"role,true"` // Ignores people with this role, requirerole is ignored if this is set IgnoreRole int64 `json:"ban_role,string" schema:"ignore_role" valid:"role,true"` // Requires people to have this role RequireRole int64 `json:"require_role,string" schema:"require_role" valid:"role,true"` // Channel to send streaming announcements in AnnounceChannel int64 `json:"announce_channel,string" schema:"announce_channel" valid:"channel,true"` // The message AnnounceMessage string `json:"announce_message" schema:"announce_message" valid:"template,2000"` // Match the game name or title against these to filter users out GameRegex string `json:"game_regex" schema:"game_regex" valid:"regex,2000"` TitleRegex string `json:"title_regex" schema:"title_regex" valid:"regex,2000"` }
func BotCachedGetConfig ¶
func BotCachedGetConfig(gs *dstate.GuildState) (*Config, error)
func (*Config) MeetsRequirements ¶
func (config *Config) MeetsRequirements(ms *dstate.MemberState) bool
func (*Config) UnmarshalJSON ¶
type LegacyConfig ¶
type LegacyConfig struct { Enabled bool `json:"enabled" schema:"enabled"` // Wether streaming notifications is enabled or not // Give a role to people streaming GiveRole string `json:"give_role" schema:"give_role" valid:"role,true"` // Ignores people with this role, requirerole is ignored if this is set IgnoreRole string `json:"ban_role" schema:"ignore_role" valid:"role,true"` // Requires people to have this role RequireRole string `json:"require_role" schema:"require_role" valid:"role,true"` // Channel to send streaming announcements in AnnounceChannel string `json:"announce_channel" schema:"announce_channel" valid:"channel,true"` // The message AnnounceMessage string `json:"announce_message" schema:"announce_message" valid:"template,2000"` // Match the game name or title against these to filter users out GameRegex string `json:"game_regex" schema:"game_regex" valid:"regex,2000"` TitleRegex string `json:"title_regex" schema:"title_regex" valid:"regex,2000"` }
type Plugin ¶
type Plugin struct{}
func (*Plugin) LoadServerHomeWidget ¶
func (p *Plugin) LoadServerHomeWidget(w http.ResponseWriter, r *http.Request) (web.TemplateData, error)
func (*Plugin) PluginInfo ¶
func (p *Plugin) PluginInfo() *common.PluginInfo
func (*Plugin) ServerHomeWidgetApplyMiddlewares ¶
func (*Plugin) ShardMigrationReceive ¶
func (p *Plugin) ShardMigrationReceive(evt dshardorchestrator.EventType, data interface{})
Click to show internal directories.
Click to hide internal directories.