Documentation ¶
Index ¶
- Constants
- func Bool(v bool) *bool
- func ColorToImage(c color.Color) image.Image
- func ColorToInt(c color.Color) int
- func GenerateEventChannelName(eventName string, location string, dateTime time.Time) string
- func GetCityFromLocation(location string) string
- func GetMonthPrefix(dateTime time.Time) string
- func HexToColor(s string) (color.Color, error)
- func ImageToBase64(img image.Image) string
- func Int(v int) *int
- func IntToColor(hex int) color.Color
- type Channel
- type Config
- type DiscordConfig
- type Feature
- type Features
- type Feedback
- type MastodonConfig
- type RoleConfig
- type RoleSelectionConfig
- type StatusPortal
Constants ¶
const RemoteLocation string = "online"
RemoteLocation is the string used to identify a online event
Variables ¶
This section is empty.
Functions ¶
func ColorToImage ¶ added in v0.4.4
ColorToImage creates a 16x16 image filled with the specified color.
func ColorToInt ¶ added in v0.3.0
ColorToInt converts a Go Color to a hex int
func GenerateEventChannelName ¶ added in v0.3.0
GenerateEventChannelName deciphers a channel name from a given set of event data
func GetCityFromLocation ¶ added in v0.3.0
GetCityFromLocation returns the city name of an event's location
func GetMonthPrefix ¶ added in v0.3.0
GetMonthPrefix returns a month in short form
func HexToColor ¶ added in v0.3.0
HexToColor coverts hex string to color
func ImageToBase64 ¶ added in v0.4.4
func IntToColor ¶ added in v0.3.0
IntToColor converts a hex int to a Go Color
Types ¶
type Channel ¶
func GenerateChannelFromEvent ¶ added in v0.3.0
GenerateChannelFromEvent returns a channel object associated with an event
type Config ¶
type Config struct { Discord DiscordConfig `yaml:"discord"` Mastodon MastodonConfig `yaml:"mastodon"` Feedback Feedback `yaml:"feedback"` StatusPortal StatusPortal `yaml:"status_portal"` Features Features `yaml:"features"` }
Config is used to modify the behavior of birdbot externally
type DiscordConfig ¶
type DiscordConfig struct { Token string `yaml:"token" env:"DISCORD_TOKEN"` ApplicationID string `yaml:"application_id" env:"DISCORD_APPLICATION_ID"` GuildID string `yaml:"guild_id" env:"DISCORD_GUILD_ID"` EventCategory string `yaml:"event_category" env:"DISCORD_EVENT_CATEGORY"` ArchiveCategory string `yaml:"archive_category" env:"DISCORD_ARCHIVE_CATEGORY"` NotificationChannel string `yaml:"notification_channel" env:"DISCORD_NOTIFICATION_CHANNEL"` RoleSelections []RoleSelectionConfig `yaml:"role_selection"` ChatLinks map[string][]string `yaml:"chat_links"` }
DiscordConfig contains discord specific configuration
type Feature ¶ added in v0.3.0
type Feature string
Feature is a boolean string used to toggle functionality
func (Feature) IsEnabledByDefault ¶ added in v0.3.0
IsEnabled returns true when a feature is set to be true or if the feature flag is not set at all
type Features ¶ added in v0.3.0
type Features struct { ManageEventChannels Feature `yaml:"manage_event_channels" env:"BIRD_EVENT_CHANNELS"` AnnounceEvents Feature `yaml:"announce_events" env:"BIRD_ANNOUNCE_EVENTS"` RecurringEvents Feature `yaml:"recurring_events" env:"BIRD_RECURRING_EVENTS"` RoleSelection Feature `yaml:"role_selection" env:"BIRD_ROLE_SELECTION"` Feedback Feature `yaml:"feedback" env:"BIRD_FEEDBACK"` LoadGamePlugins Feature `yaml:"load_game_plugins" env:"BIRD_LOAD_GAME_PLUGINS"` StatusPortal Feature `yaml:"status_portal" env:"BIRD_STATUS_PORTAL"` }
Features contains all features flags that can be used to modify functionality
type MastodonConfig ¶ added in v0.1.4
type MastodonConfig struct { Server string `yaml:"server" env:"MASTODON_SERVER"` Username string `yaml:"user" env:"MASTODON_USER"` Password string `yaml:"password" env:"MASTODON_PASSWORD"` ClientID string `yaml:"client_id" env:"MASTODON_CLIENT_ID"` ClientSecret string `yaml:"client_secret" env:"MASTODON_CLIENT_SECRET"` }
MastodonConfig contains mastodon specific configuration
type RoleConfig ¶ added in v0.3.0
type RoleSelectionConfig ¶ added in v0.3.0
type RoleSelectionConfig struct { Title string `yaml:"title"` Description string `yaml:"description"` GenerateColorEmoji Feature `yaml:"generate_color_emoji"` SelectionChannel string `yaml:"discord_channel"` Roles []RoleConfig `yaml:"roles"` }
type StatusPortal ¶ added in v0.4.3
type StatusPortal struct {
URL string `yaml:"url" env:"BIRD_STATUS_PORTAL_URL"`
}