mirror of
https://git.klmp200.net/ALFRED/ALFRED.git
synced 2025-01-18 10:36:44 +01:00
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:
parent
30397b9207
commit
7b4f2d3b25
@ -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)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user