Externalized all commands in corresponding package

This commit is contained in:
klmp200 2018-07-24 12:21:50 +02:00
parent f7f3308372
commit 7336770332
No known key found for this signature in database
GPG key ID: E7245548C53F904B
5 changed files with 80 additions and 18 deletions

17
commands/framapad.go Normal file
View file

@ -0,0 +1,17 @@
/*
* @Author: Bartuccio Antoine
* @Date: 2018-07-24 12:11:26
* @Last Modified by: klmp200
* @Last Modified time: 2018-07-24 12:12:58
*/
package commands
import (
"../shared"
tb "gopkg.in/tucnak/telebot.v2"
)
func Framapad(m *tb.Message) {
shared.Bot.Send(m.Chat, "Venez participer à mon développement en posant vos idées ici : https://mensuel.framapad.org/p/ALFRED2LERETOUR.")
}

17
commands/git.go Normal file
View file

@ -0,0 +1,17 @@
/*
* @Author: Bartuccio Antoine
* @Date: 2018-07-24 12:07:34
* @Last Modified by: klmp200
* @Last Modified time: 2018-07-24 12:08:49
*/
package commands
import (
"../shared"
tb "gopkg.in/tucnak/telebot.v2"
)
func Git(m *tb.Message) {
shared.Bot.Send(m.Chat, "Mon code source est accessible librement à l'adresse https://git.klmp200.net/ALFRED/ALFRED. Venez contribuer :)")
}

17
commands/hello.go Normal file
View file

@ -0,0 +1,17 @@
/*
* @Author: Bartuccio Antoine
* @Date: 2018-07-24 12:05:45
* @Last Modified by: klmp200
* @Last Modified time: 2018-07-24 12:06:39
*/
package commands
import (
"../shared"
tb "gopkg.in/tucnak/telebot.v2"
)
func Hello(m *tb.Message) {
shared.Bot.Send(m.Chat, "Bonjour "+m.Sender.Username)
}

17
commands/on_text.go Normal file
View file

@ -0,0 +1,17 @@
/*
* @Author: Bartuccio Antoine
* @Date: 2018-07-24 12:09:37
* @Last Modified by: klmp200
* @Last Modified time: 2018-07-24 12:10:26
*/
package commands
import (
"../shared"
tb "gopkg.in/tucnak/telebot.v2"
)
func OnText(m *tb.Message) {
shared.History.AddMessage(m.Chat.ID, m.Text)
}