Add welcome message functionality

(Telegram and whatsapp for now)
This commit is contained in:
Yousef Mansy
2023-03-15 02:12:49 -07:00
parent 08692ee180
commit 5bc8231b2d
7 changed files with 211 additions and 26 deletions

View File

@@ -15,6 +15,7 @@ import (
)
const (
EventWelcomeMsg = "welcome"
EventJoinLeave = "join_leave"
EventTopicChange = "topic_change"
EventFailure = "failure"

View File

@@ -287,7 +287,9 @@ func (b *Btelegram) handleUserJoin(update tgbotapi.Update) {
Event: config.EventJoinLeave,
Text: "joined chat",
}
b.Remote <- rmsg
rmsg.Event = config.EventWelcomeMsg
b.Remote <- rmsg
}
}

View File

@@ -53,7 +53,9 @@ func (b *Bwhatsapp) handleUserJoin(event *events.GroupInfo) {
Event: config.EventJoinLeave,
Text: "joined chat",
}
b.Remote <- rmsg
rmsg.Event = config.EventWelcomeMsg
b.Remote <- rmsg
}
}