This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sentenceStartMap = map[string]string{ | |
"january": "Way to Go!", | |
"december": "Magnificent Effort!", | |
} | |
var sentenceAdjectiveMap = map[string]string{ | |
"a": "You Rainbow-Infused", | |
"b": "You Molten", | |
"c": "You Inspiring", | |
"z": "You Clever", | |
} | |
var sentenceNounMap = map[string]string{ | |
"a": "Echidna!", | |
"b": "Musk Ox!", | |
"c": "Land Mermaid", | |
"y": "Apocalyptic gladiator", | |
"z": "Genius", | |
} | |
sentenceParts := []string{} | |
sentenceStart, ok := sentenceStartMap[strings.ToLower(month)] | |
if !ok { | |
rtm.SendMessage(rtm.NewOutgoingMessage("I Believe in You", ev.Channel)) | |
} | |
sentenceParts = append(sentenceParts, sentenceStart) | |
firstNameLetter := strings.ToLower(string(firstName[0])) | |
sentenceAdjective, ok := sentenceAdjectiveMap[firstNameLetter] | |
if !ok { | |
rtm.SendMessage(rtm.NewOutgoingMessage("I Believe in You", ev.Channel)) | |
} | |
sentenceParts = append(sentenceParts, sentenceAdjective) | |
lastNameLetter := strings.ToLower(string(lastName[0])) | |
sentenceNoun, ok := sentenceNounMap[lastNameLetter] | |
if !ok { | |
rtm.SendMessage(rtm.NewOutgoingMessage("I Believe in You", ev.Channel)) | |
} | |
sentenceParts = append(sentenceParts, sentenceNoun) | |
message := strings.Join(sentenceParts, " ") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment