Begin commands package

This commit is contained in:
klmp200 2018-07-24 11:59:36 +02:00
parent 8a9592ad27
commit f7f3308372
No known key found for this signature in database
GPG key ID: E7245548C53F904B
4 changed files with 53 additions and 15 deletions

27
commands/sponge.go Normal file
View file

@ -0,0 +1,27 @@
/*
* @Author: Bartuccio Antoine
* @Date: 2018-07-24 11:52:11
* @Last Modified by: klmp200
* @Last Modified time: 2018-07-24 11:58:42
*/
package commands
import (
"../shared"
tb "gopkg.in/tucnak/telebot.v2"
"strings"
)
func Sponge(m *tb.Message) {
message := ""
for i, char := range shared.History.LastMessage(m.Chat.ID) {
if i%2 == 0 {
message += strings.ToLower(string(char))
} else {
message += strings.ToUpper(string(char))
}
}
shared.Bot.Send(m.Chat, message)
}