prompt util func to reduce code reuse

This commit is contained in:
Cynthia Foxwell 2023-07-10 21:41:51 -06:00
parent f21c414f1b
commit 1593736c70
4 changed files with 61 additions and 29 deletions

View file

@ -15,6 +15,7 @@ type ComcordState struct {
CurrentChannel string
NameLength int
InPrompt bool
PromptText string
AFK bool
MessageQueue []*discordgo.Message
LastChannel map[string]string
@ -34,6 +35,7 @@ func Setup(config map[string]string) {
state.CurrentChannel = ""
state.NameLength = 2
state.InPrompt = false
state.PromptText = ""
state.AFK = false
state.MessageQueue = make([]*discordgo.Message, 0)
state.LastChannel = make(map[string]string)
@ -93,6 +95,14 @@ func SetInPrompt(value bool) {
state.InPrompt = value
}
func GetPromptText() string {
return state.PromptText
}
func SetPromptText(value string) {
state.PromptText = value
}
func IsAFK() bool {
return state.AFK
}