Documentation ¶
Index ¶
- Variables
- func AddGuild(gID string) error
- func CloseRedis()
- func GetGuildsWithSounds(session *discordgo.Session) (interface{}, error)
- func GuildHasAirhorn(gID string) (bool, error)
- func InitRedis(cfg Cfg) bool
- func SaveAudio(a io.Reader, n string) error
- func UtilGetRedisValuesFor(redisPool *redis.Pool, keys []string) (r []interface{}, err error)
- type Cfg
- type CountUpdate
- type Guild
- type Sound
- type UserGuilds
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultSounds = []*Sound{ { Name: "airhorn_default", Weight: 1000, Commands: []string{"airhorn"}, FilePath: "../audio/airhorn_default.dca", }, { Name: "airhorn_reverb", Weight: 800, Commands: []string{"airhorn"}, FilePath: "../audio/airhorn_reverb.dca", }, { Name: "airhorn_spam", Weight: 800, Commands: []string{"airhorn"}, FilePath: "../audio/airhorn_spam.dca", }, { Name: "airhorn_tripletap", Weight: 800, Commands: []string{"airhorn"}, FilePath: "../audio/airhorn_tripletap.dca", }, { Name: "airhorn_fourtap", Weight: 800, Commands: []string{"airhorn"}, FilePath: "../audio/airhorn_fourtap.dca", }, { Name: "airhorn_distant", Weight: 500, Commands: []string{"airhorn"}, FilePath: "../audio/airhorn_distant.dca", }, { Name: "airhorn_echo", Weight: 500, Commands: []string{"airhorn"}, FilePath: "../audio/airhorn_echo.dca", }, { Name: "airhorn_clownfull", Weight: 250, Commands: []string{"airhorn"}, FilePath: "../audio/airhorn_clownfull.dca", }, { Name: "airhorn_clownshort", Weight: 250, Commands: []string{"airhorn"}, FilePath: "../audio/airhorn_clownshort.dca", }, { Name: "airhorn_clownspam", Weight: 250, Commands: []string{"airhorn"}, FilePath: "../audio/airhorn_clownspam.dca", }, { Name: "airhorn_highfartlong", Weight: 200, Commands: []string{"airhorn"}, FilePath: "../audio/airhorn_highfartlong.dca", }, { Name: "airhorn_highfartshort", Weight: 200, Commands: []string{"airhorn"}, FilePath: "../audio/airhorn_highfartshot.dca", }, { Name: "airhorn_midshort", Weight: 100, Commands: []string{"airhorn"}, FilePath: "../audio/airhorn_midshort.dca", }, { Name: "airhorn_truck", Weight: 10, Commands: []string{"airhorn"}, FilePath: "../audio/airhorn_truck.dca", }, { Name: "another_one", Weight: 1, Commands: []string{"anotha"}, FilePath: "../audio/another_one.dca", }, { Name: "another_one_classic", Weight: 1, Commands: []string{"anotha"}, FilePath: "../audio/another_one_classic.dca", }, { Name: "another_one_echo", Weight: 1, Commands: []string{"anotha"}, FilePath: "../audio/another_one_echo.dca", }, { Name: "jc_realfull", Weight: 1, Commands: []string{"cena"}, FilePath: "../audio/jc_realfull.dca", }, { Name: "cow_herd", Weight: 10, Commands: []string{"stan"}, FilePath: "../audio/cow_herd.dca", }, { Name: "cow_moo", Weight: 10, Commands: []string{"stan"}, FilePath: "../audio/cow_moo.dca", }, { Name: "cow_x3", Weight: 1, Commands: []string{"stan"}, FilePath: "../audio/cow_x3.dca", }, { Name: "birthday_horn", Weight: 50, Commands: []string{"bday"}, FilePath: "../audio/birthday_horn.dca", }, { Name: "birthday_horn3", Weight: 30, Commands: []string{"bday"}, FilePath: "../audio/birthday_horn3.dca", }, { Name: "birthday_sadhorn", Weight: 25, Commands: []string{"bday"}, FilePath: "../audio/birthday_sadhorn.dca", }, { Name: "birthday_weakhorn", Weight: 25, Commands: []string{"bday"}, FilePath: "../audio/birthday_weakhorn.dca", }, { Name: "wow_thatscool", Weight: 1, Commands: []string{"wtc"}, FilePath: "../audio/wow_thatscool.dca", }, }
DefaultSounds are a set of default sounds available to every servers
Functions ¶
func GetGuildsWithSounds ¶
GetGuildsWithSounds retrieves a guild from Discord and its sounds
func GuildHasAirhorn ¶
GuildHasAirhorn checks if a guild has already been used with airhorn
Types ¶
type Cfg ¶
type Cfg struct { DBDriver string DBSSL bool DBHost string DBPort string DBUser string DBPassword string DBName string RedisHost string DiscordToken string DiscordClientID string DiscordClientSecret string DataPath string PluginPath string DiscordOwnerID string }
Cfg represents the app configuration
type CountUpdate ¶
type CountUpdate struct { Total string `json:"total"` UniqueUsers string `json:"unique_users"` UniqueGuilds string `json:"unique_guilds"` UniqueChannels string `json:"unique_channels"` }
CountUpdate represents a JSON struct of stats that are updated every second and pushed to the client
func (*CountUpdate) ToJSON ¶
func (c *CountUpdate) ToJSON() []byte
ToJSON format CountUpdate in JSON
type Guild ¶
type Guild struct { ID string `json:"id"` Name string `json:"name"` Icon string `json:"icon"` Sounds []*Sound `json:"sounds"` }
Guild represents a discord server
type Sound ¶
type Sound struct { ID string `json:"id"` GuildID string `json:"guildId"` Name string `json:"name"` // Link to a gif url Gif string `json:"gif"` // Weight adjust how likely it is this song will play, higher = more likely Weight int `json:"weight"` // Command to type in channel Commands []string `json:"commands"` CommandsString string FilePath string `json:"filepath"` }
Sound represents a sound clip
func FilterByCommand ¶
FilterByCommand filter a sound array by command
func GetSoundsByCommand ¶
GetSoundsByCommand return all sounds for a given command
func GetSoundsByGuild ¶
GetSoundsByGuild return all sounds for a given Guild
type UserGuilds ¶
UserGuilds represents a user's guilds
Click to show internal directories.
Click to hide internal directories.