Compare commits

...

2 Commits

Author SHA1 Message Date
madahin 30397b9207 Fix formating with `go fmt` 2020-11-09 19:14:21 +01:00
madahin e786b77f62 Fix identation 2020-11-09 19:12:14 +01:00
1 changed files with 8 additions and 8 deletions

View File

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