Documentation
¶
Index ¶
- Variables
- type Bot
- type Controller
- func (c *Controller) AddSubscription(channelID, guildID string, feedID int) (*Subscription, error)
- func (c *Controller) CreateGuildConfig(guildID string, ownerContact string) error
- func (c *Controller) CreateTables() error
- func (c *Controller) DestroyGuildData(guildID string)
- func (c *Controller) DestroySubscription(id int) error
- func (c *Controller) GetFeeds() ([]Feed, error)
- func (c *Controller) GetGuildConfig(guildID string) (*GuildConfig, error)
- func (c *Controller) GetOrCreateFeed(uri string) (*Feed, error)
- func (c *Controller) GetSubscription(id int) (*Subscription, error)
- func (c *Controller) GetSubscriptions(guildID string) ([]Subscription, error)
- func (c *Controller) ModifyGuildContact(guildID string, contact string) error
- func (c *Controller) ModifyGuildEmbeds(guildID string, embeds bool) error
- func (c *Controller) ModifyGuildWebhooks(guildID string, embeds bool) error
- func (c *Controller) ModifyOverwriteEmbeds(subID int, embeds sql.NullBool) error
- func (c *Controller) ModifyOverwriteWebhooks(subID int, webhooks sql.NullBool) error
- func (c *Controller) ModifySubscriptionChannel(id int, channelID string) error
- func (c *Controller) UpdateFeedTimestamp(feed *Feed, timestamp *time.Time) error
- type Feed
- type FeedChecker
- type GuildConfig
- type Overwrite
- type Subscription
Constants ¶
This section is empty.
Variables ¶
var ( // ErrSubExists is returned when a subscription already exists for a feed/channel ErrSubExists = errors.New("a subscription already exists") )
Functions ¶
This section is empty.
Types ¶
type Bot ¶
type Bot struct {
// contains filtered or unexported fields
}
Bot contains the Bot's state
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller contains logic for manipulating the database
func NewController ¶
func NewController() (*Controller, error)
NewController creates a new controller
func (*Controller) AddSubscription ¶
func (c *Controller) AddSubscription(channelID, guildID string, feedID int) (*Subscription, error)
AddSubscription adds a subscription to the given feed for a channel
func (*Controller) CreateGuildConfig ¶
func (c *Controller) CreateGuildConfig(guildID string, ownerContact string) error
CreateGuildConfig creates an empty GuildConfig for a guild
func (*Controller) CreateTables ¶
func (c *Controller) CreateTables() error
CreateTables should only be called once; this will initalize the database for use with the bot.
func (*Controller) DestroyGuildData ¶
func (c *Controller) DestroyGuildData(guildID string)
DestroyGuildData removes all data assosciated with a guild.
func (*Controller) DestroySubscription ¶
func (c *Controller) DestroySubscription(id int) error
DestroySubscription deletes a subscription from the database
func (*Controller) GetFeeds ¶
func (c *Controller) GetFeeds() ([]Feed, error)
GetFeeds will get a list of feeds to query from the database
func (*Controller) GetGuildConfig ¶
func (c *Controller) GetGuildConfig(guildID string) (*GuildConfig, error)
GetGuildConfig gets a guild's config
func (*Controller) GetOrCreateFeed ¶
func (c *Controller) GetOrCreateFeed(uri string) (*Feed, error)
GetOrCreateFeed will insert a new RSS Feed to the database if one does not exist, and return a Feed for it.
func (*Controller) GetSubscription ¶
func (c *Controller) GetSubscription(id int) (*Subscription, error)
GetSubscription gets a subscription from its ID
func (*Controller) GetSubscriptions ¶
func (c *Controller) GetSubscriptions(guildID string) ([]Subscription, error)
GetSubscriptions selects all subscriptions for a given guild
func (*Controller) ModifyGuildContact ¶
func (c *Controller) ModifyGuildContact(guildID string, contact string) error
ModifyGuildContact changes the guild's contact address
func (*Controller) ModifyGuildEmbeds ¶
func (c *Controller) ModifyGuildEmbeds(guildID string, embeds bool) error
ModifyGuildEmbeds changes the guild's embed rule
func (*Controller) ModifyGuildWebhooks ¶
func (c *Controller) ModifyGuildWebhooks(guildID string, embeds bool) error
ModifyGuildWebhooks changes the guild's webhook rule
func (*Controller) ModifyOverwriteEmbeds ¶
func (c *Controller) ModifyOverwriteEmbeds(subID int, embeds sql.NullBool) error
ModifyOverwriteEmbeds changes the embeds policy of a subscription overwrite
func (*Controller) ModifyOverwriteWebhooks ¶
func (c *Controller) ModifyOverwriteWebhooks(subID int, webhooks sql.NullBool) error
ModifyOverwriteWebhooks changes the webhooks policy of a subscription overwrite
func (*Controller) ModifySubscriptionChannel ¶
func (c *Controller) ModifySubscriptionChannel(id int, channelID string) error
ModifySubscriptionChannel changes the channel_id for a Subscription
func (*Controller) UpdateFeedTimestamp ¶
func (c *Controller) UpdateFeedTimestamp(feed *Feed, timestamp *time.Time) error
UpdateFeedTimestamp updates a feed's last_updated value
type FeedChecker ¶
type FeedChecker struct {
// contains filtered or unexported fields
}
FeedChecker contains the application logic for checking RSS feeds
func NewFeedChecker ¶
func NewFeedChecker(c *Controller) (*FeedChecker, error)
NewFeedChecker creates a new FeedChecker
type GuildConfig ¶
GuildConfig contains guild-wide configuration