Use camelCase instead of snake_case

Because this shity language can't deal with snake_case and
the snake_case evangile is a traitor to it's cause.
This commit is contained in:
madahin 2020-11-09 19:24:22 +01:00
parent 30397b9207
commit 7b4f2d3b25
1 changed files with 9 additions and 8 deletions

View File

@ -15,24 +15,25 @@ import (
tb "gopkg.in/tucnak/telebot.v2"
)
func Spongify(input_message string) string {
spongified_message := ""
for i, char := range input_message {
func spongify(inputMessage string) string {
spongifiedMessage := ""
for i, char := range inputMessage {
if i%2 == 0 {
spongified_message += strings.ToLower(string(char))
spongifiedMessage += strings.ToLower(string(char))
} else {
spongified_message += strings.ToUpper(string(char))
spongifiedMessage += strings.ToUpper(string(char))
}
}
return spongified_message
return spongifiedMessage
}
func Sponge(m *tb.Message) {
message := ""
if m.IsReply() {
message = Spongify(m.ReplyTo.Text)
message = spongify(m.ReplyTo.Text)
} else {
message = Spongify(shared.History.LastMessage(m.Chat.ID))
message = spongify(shared.History.LastMessage(m.Chat.ID))
}
shared.Bot.Send(m.Chat, message)
}