forked from git.klmp200.net/ALFRED
Begin commands package
This commit is contained in:
parent
8a9592ad27
commit
f7f3308372
4 changed files with 53 additions and 15 deletions
27
commands/sponge.go
Normal file
27
commands/sponge.go
Normal 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)
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue