settings

package
v0.0.19 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultLang = "en"
View Source
const DefaultLeaderboardMin = 3
View Source
const DefaultLeaderboardSize = 3
View Source
const DefaultLocalePath = "locales/"

Variables

View Source
var GlobalBundle *i18n.Bundle

Functions

func InitLang

func InitLang(localePath, lang string)

func LoadTranslations

func LoadTranslations(localePath, lang string) *i18n.Bundle

func LocalizeMessage

func LocalizeMessage(args ...interface{}) string

Types

type GuildSettings

type GuildSettings struct {
	AdminUserIDs             []string        `json:"adminIDs"`
	PermissionRoleIDs        []string        `json:"permissionRoleIDs"`
	CommandPrefix            string          `json:"commandPrefix"`
	Language                 string          `json:"language"`
	VoiceRules               game.VoiceRules `json:"voiceRules"`
	MapVersion               string          `json:"mapVersion"`
	Delays                   game.GameDelays `json:"delays"`
	DeleteGameSummaryMinutes int             `json:"deleteGameSummary"`

	UnmuteDeadDuringTasks bool   `json:"unmuteDeadDuringTasks"`
	AutoRefresh           bool   `json:"autoRefresh"`
	MatchSummaryChannelID string `json:"matchSummaryChannelID"`
	LeaderboardMention    bool   `json:"leaderboardMention"`
	LeaderboardSize       int    `json:"leaderboardSize"`
	LeaderboardMin        int    `json:"leaderboardMin"`
	MuteSpectator         bool   `json:"muteSpectator"`
	// contains filtered or unexported fields
}

func MakeGuildSettings

func MakeGuildSettings(prefix string) *GuildSettings

func (*GuildSettings) GetAdminUserIDs

func (gs *GuildSettings) GetAdminUserIDs() []string

func (*GuildSettings) GetAutoRefresh

func (gs *GuildSettings) GetAutoRefresh() bool

func (*GuildSettings) GetCommandPrefix

func (gs *GuildSettings) GetCommandPrefix() string

func (*GuildSettings) GetDelay

func (gs *GuildSettings) GetDelay(oldPhase, newPhase game.Phase) int

func (*GuildSettings) GetDeleteGameSummaryMinutes

func (gs *GuildSettings) GetDeleteGameSummaryMinutes() int

func (*GuildSettings) GetLanguage

func (gs *GuildSettings) GetLanguage() string

func (*GuildSettings) GetLeaderboardMention

func (gs *GuildSettings) GetLeaderboardMention() bool

func (*GuildSettings) GetLeaderboardMin

func (gs *GuildSettings) GetLeaderboardMin() int

func (*GuildSettings) GetLeaderboardSize

func (gs *GuildSettings) GetLeaderboardSize() int

func (*GuildSettings) GetMapVersion

func (gs *GuildSettings) GetMapVersion() string

func (*GuildSettings) GetMatchSummaryChannelID

func (gs *GuildSettings) GetMatchSummaryChannelID() string

func (*GuildSettings) GetMuteSpectator

func (gs *GuildSettings) GetMuteSpectator() bool

func (*GuildSettings) GetPermissionRoleIDs

func (gs *GuildSettings) GetPermissionRoleIDs() []string

func (*GuildSettings) GetUnmuteDeadDuringTasks

func (gs *GuildSettings) GetUnmuteDeadDuringTasks() bool

func (*GuildSettings) GetVoiceRule

func (gs *GuildSettings) GetVoiceRule(isMute bool, phase game.Phase, alive string) bool

func (*GuildSettings) GetVoiceState

func (gs *GuildSettings) GetVoiceState(alive bool, tracked bool, phase game.Phase) (bool, bool)

func (*GuildSettings) HasAdminPerms

func (gs *GuildSettings) HasAdminPerms(user *discordgo.User) bool

func (*GuildSettings) HasRolePerms

func (gs *GuildSettings) HasRolePerms(mem *discordgo.Member) bool

func (*GuildSettings) LocalizeMessage

func (gs *GuildSettings) LocalizeMessage(args ...interface{}) string

func (*GuildSettings) SetAdminUserIDs

func (gs *GuildSettings) SetAdminUserIDs(ids []string)

func (*GuildSettings) SetAutoRefresh

func (gs *GuildSettings) SetAutoRefresh(n bool)

func (*GuildSettings) SetCommandPrefix

func (gs *GuildSettings) SetCommandPrefix(p string)

func (*GuildSettings) SetDelay

func (gs *GuildSettings) SetDelay(oldPhase, newPhase game.Phase, v int)

func (*GuildSettings) SetDeleteGameSummaryMinutes

func (gs *GuildSettings) SetDeleteGameSummaryMinutes(num int)

func (*GuildSettings) SetLanguage

func (gs *GuildSettings) SetLanguage(l string)

func (*GuildSettings) SetLeaderboardMention

func (gs *GuildSettings) SetLeaderboardMention(v bool)

func (*GuildSettings) SetLeaderboardMin

func (gs *GuildSettings) SetLeaderboardMin(v int)

func (*GuildSettings) SetLeaderboardSize

func (gs *GuildSettings) SetLeaderboardSize(v int)

func (*GuildSettings) SetMapVersion

func (gs *GuildSettings) SetMapVersion(n string)

func (*GuildSettings) SetMatchSummaryChannelID

func (gs *GuildSettings) SetMatchSummaryChannelID(id string)

func (*GuildSettings) SetMuteSpectator

func (gs *GuildSettings) SetMuteSpectator(behavior bool)

func (*GuildSettings) SetPermissionRoleIDs

func (gs *GuildSettings) SetPermissionRoleIDs(ids []string)

func (*GuildSettings) SetUnmuteDeadDuringTasks

func (gs *GuildSettings) SetUnmuteDeadDuringTasks(v bool)

func (*GuildSettings) SetVoiceRule

func (gs *GuildSettings) SetVoiceRule(isMute bool, phase game.Phase, alive string, val bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL