diff options
| author | Nathan Perry <avaglir@gmail.com> | 2017-07-29 16:39:57 -0400 |
|---|---|---|
| committer | Nathan Perry <avaglir@gmail.com> | 2017-07-29 16:39:57 -0400 |
| commit | eb12be6f8315973bfb3e39c259c00d325889c32c (patch) | |
| tree | edf28ba06a7184ff630401ea5ef967524b5fc596 /util.go | |
| parent | b562764a74caa986b99b523dbf78beced6fc1e88 (diff) | |
refactor works
Diffstat (limited to 'util.go')
| -rw-r--r-- | util.go | 30 |
1 files changed, 21 insertions, 9 deletions
@@ -28,15 +28,27 @@ commands: var log = logging.MustGetLogger("thulani") type Config struct { - Trigger string `json:"trigger"` - QueueSize uint `json:"queue_size"` - Admin uint `json:"admin"` - OpRole string `json:"op_role"` - Server string `json:"server"` - VoiceChannel string `json:"voice_channel"` - Token string `json:"token"` - ClientID string `json:"client_id"` - ClientSecret string `json:"client_secret"` + Trigger string `json:"trigger"` + QueueSize uint `json:"queue_size"` + AdminID uint `json:"admin_id"` + OpRole string `json:"op_role"` + GuildID uint `json:"guild_id"` + VoiceChannelID uint `json:"voice_channel_id"` + Token string `json:"token"` + ClientID string `json:"client_id"` + ClientSecret string `json:"client_secret"` +} + +func (c *Config) GuildStr() string { + return strconv.Itoa(int(c.GuildID)) +} + +func (c *Config) VoiceChannelStr() string { + return strconv.Itoa(int(c.VoiceChannelID)) +} + +func (c *Config) AdminStr() string { + return strconv.Itoa(int(c.AdminID)) } func handle(err error) { |
