implement !help
This commit is contained in:
parent
fa3105d058
commit
798a3dfd2c
10
commands.go
10
commands.go
@ -73,6 +73,8 @@ func (handler *CommandHandler) Handle(roomID types.MatrixRoomID, user *User, mes
|
||||
}
|
||||
}
|
||||
|
||||
const cmdLoginHelp = `!login - Authenticate this Bridge as WhatsApp Web Client`
|
||||
|
||||
func (handler *CommandHandler) CommandLogin(ce *CommandEvent) {
|
||||
if ce.User.Session != nil {
|
||||
ce.Reply("You're already logged in.")
|
||||
@ -83,6 +85,8 @@ func (handler *CommandHandler) CommandLogin(ce *CommandEvent) {
|
||||
ce.User.Login(ce.RoomID)
|
||||
}
|
||||
|
||||
const cmdLogoutHelp = `!logout - Logout from WhatsApp`
|
||||
|
||||
func (handler *CommandHandler) CommandLogout(ce *CommandEvent) {
|
||||
if ce.User.Session == nil {
|
||||
ce.Reply("You're not logged in.")
|
||||
@ -100,6 +104,10 @@ func (handler *CommandHandler) CommandLogout(ce *CommandEvent) {
|
||||
ce.Reply("Logged out successfully.")
|
||||
}
|
||||
|
||||
// CommandHelp handles !help command
|
||||
func (handler *CommandHandler) CommandHelp(ce *CommandEvent) {
|
||||
ce.Reply("Help is not yet implemented 3:")
|
||||
ce.Reply(strings.Join([]string{
|
||||
cmdLoginHelp,
|
||||
cmdLogoutHelp,
|
||||
}, "\n"))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user