This commit is contained in:
parent
8b138cadda
commit
5e83b1ace4
7
main.go
7
main.go
@ -16,7 +16,6 @@ import (
|
||||
var bot *tgbotapi.BotAPI
|
||||
var client *crisp.Client
|
||||
|
||||
// var redisClient *redis.Client
|
||||
var config *viper.Viper
|
||||
|
||||
// CrispMessageInfo stores the original message
|
||||
@ -84,19 +83,19 @@ func main() {
|
||||
|
||||
// Register handler on 'message:send/text' namespace
|
||||
reg.On("message:send/text", func(evt crisp.EventsReceiveTextMessage) {
|
||||
text := fmt.Sprintf(`(%s) *%s(%s): *%s`, chat_prefix, *evt.User.Nickname, *evt.User.UserID, *evt.Content)
|
||||
text := fmt.Sprintf(`%s *%s: *%s`, chat_prefix, *evt.User.Nickname, *evt.Content)
|
||||
sendMsgToAdmins(text, *evt.WebsiteID, *evt.SessionID)
|
||||
})
|
||||
|
||||
// Register handler on 'message:send/file' namespace
|
||||
reg.On("message:send/file", func(evt crisp.EventsReceiveFileMessage) {
|
||||
text := fmt.Sprintf(`(%s) *%s(%s): *[File](%s)`, chat_prefix, *evt.User.Nickname, *evt.User.UserID, evt.Content.URL)
|
||||
text := fmt.Sprintf(`%s *%s: *[File](%s)`, chat_prefix, *evt.User.Nickname, evt.Content.URL)
|
||||
sendMsgToAdmins(text, *evt.WebsiteID, *evt.SessionID)
|
||||
})
|
||||
|
||||
// Register handler on 'message:send/animation' namespace
|
||||
reg.On("message:send/animation", func(evt crisp.EventsReceiveAnimationMessage) {
|
||||
text := fmt.Sprintf(`(%s) *%s(%s): *[Animation](%s)`, chat_prefix, *evt.User.Nickname, *evt.User.UserID, evt.Content.URL)
|
||||
text := fmt.Sprintf(`%s *%s: *[Animation](%s)`, chat_prefix, *evt.User.Nickname, evt.Content.URL)
|
||||
sendMsgToAdmins(text, *evt.WebsiteID, *evt.SessionID)
|
||||
})
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user