mirror of
https://github.com/tulir/mautrix-whatsapp
synced 2024-12-14 09:23:51 +01:00
Add error responses to unimplemented commands
This commit is contained in:
parent
b2e6a614b9
commit
43a9d90b13
1 changed files with 21 additions and 15 deletions
36
commands.go
36
commands.go
|
@ -232,6 +232,7 @@ func (handler *CommandHandler) CommandInviteLink(ce *CommandEvent) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ce.Reply("Not yet implemented")
|
||||||
// TODO reimplement
|
// TODO reimplement
|
||||||
//link, err := ce.User.Conn.GroupInviteLink(ce.Portal.Key.JID)
|
//link, err := ce.User.Conn.GroupInviteLink(ce.Portal.Key.JID)
|
||||||
//if err != nil {
|
//if err != nil {
|
||||||
|
@ -253,6 +254,7 @@ func (handler *CommandHandler) CommandJoin(ce *CommandEvent) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ce.Reply("Not yet implemented")
|
||||||
// TODO reimplement
|
// TODO reimplement
|
||||||
//jid, err := ce.User.Conn.GroupAcceptInviteCode(ce.Args[0][len(inviteLinkPrefix):])
|
//jid, err := ce.User.Conn.GroupAcceptInviteCode(ce.Args[0][len(inviteLinkPrefix):])
|
||||||
//if err != nil {
|
//if err != nil {
|
||||||
|
@ -315,6 +317,7 @@ func (handler *CommandHandler) CommandCreate(ce *CommandEvent) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ce.Reply("Not yet implemented")
|
||||||
// TODO reimplement
|
// TODO reimplement
|
||||||
//resp, err := ce.User.Conn.CreateGroup(roomNameEvent.Name, participants)
|
//resp, err := ce.User.Conn.CreateGroup(roomNameEvent.Name, participants)
|
||||||
//if err != nil {
|
//if err != nil {
|
||||||
|
@ -512,21 +515,21 @@ func (handler *CommandHandler) CommandToggle(ce *CommandEvent) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if ce.Args[0] == "presence" || ce.Args[0] == "all" {
|
if ce.Args[0] == "presence" || ce.Args[0] == "all" {
|
||||||
//customPuppet.EnablePresence = !customPuppet.EnablePresence
|
customPuppet.EnablePresence = !customPuppet.EnablePresence
|
||||||
//var newPresence whatsapp.Presence
|
var newPresence types.Presence
|
||||||
//if customPuppet.EnablePresence {
|
if customPuppet.EnablePresence {
|
||||||
// newPresence = whatsapp.PresenceAvailable
|
newPresence = types.PresenceAvailable
|
||||||
// ce.Reply("Enabled presence bridging")
|
ce.Reply("Enabled presence bridging")
|
||||||
//} else {
|
} else {
|
||||||
// newPresence = whatsapp.PresenceUnavailable
|
newPresence = types.PresenceUnavailable
|
||||||
// ce.Reply("Disabled presence bridging")
|
ce.Reply("Disabled presence bridging")
|
||||||
//}
|
}
|
||||||
//if ce.User.IsConnected() {
|
if ce.User.IsLoggedIn() {
|
||||||
// _, err := ce.User.Conn.Presence("", newPresence)
|
err := ce.User.Client.SendPresence(newPresence)
|
||||||
// if err != nil {
|
if err != nil {
|
||||||
// ce.User.log.Warnln("Failed to set presence:", err)
|
ce.User.log.Warnln("Failed to set presence:", err)
|
||||||
// }
|
}
|
||||||
//}
|
}
|
||||||
}
|
}
|
||||||
if ce.Args[0] == "receipts" || ce.Args[0] == "all" {
|
if ce.Args[0] == "receipts" || ce.Args[0] == "all" {
|
||||||
customPuppet.EnableReceipts = !customPuppet.EnableReceipts
|
customPuppet.EnableReceipts = !customPuppet.EnableReceipts
|
||||||
|
@ -555,6 +558,7 @@ func (handler *CommandHandler) CommandDeleteSession(ce *CommandEvent) {
|
||||||
const cmdReconnectHelp = `reconnect - Reconnect to WhatsApp`
|
const cmdReconnectHelp = `reconnect - Reconnect to WhatsApp`
|
||||||
|
|
||||||
func (handler *CommandHandler) CommandReconnect(ce *CommandEvent) {
|
func (handler *CommandHandler) CommandReconnect(ce *CommandEvent) {
|
||||||
|
ce.Reply("Not yet implemented")
|
||||||
// TODO reimplement
|
// TODO reimplement
|
||||||
//if ce.User.Client == nil {
|
//if ce.User.Client == nil {
|
||||||
// if ce.User.Session == nil {
|
// if ce.User.Session == nil {
|
||||||
|
@ -802,6 +806,7 @@ func (handler *CommandHandler) CommandList(ce *CommandEvent) {
|
||||||
ce.Reply("Warning: a high number of items per page may fail to send a reply")
|
ce.Reply("Warning: a high number of items per page may fail to send a reply")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ce.Reply("Not yet implemented")
|
||||||
// TODO reimplement
|
// TODO reimplement
|
||||||
//contacts := mode[0] == 'c'
|
//contacts := mode[0] == 'c'
|
||||||
//typeName := "Groups"
|
//typeName := "Groups"
|
||||||
|
@ -839,6 +844,7 @@ func (handler *CommandHandler) CommandOpen(ce *CommandEvent) {
|
||||||
ce.Reply("**Usage:** `open <group JID>`")
|
ce.Reply("**Usage:** `open <group JID>`")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
ce.Reply("Not yet implemented")
|
||||||
|
|
||||||
// TODO reimplement
|
// TODO reimplement
|
||||||
//user := ce.User
|
//user := ce.User
|
||||||
|
|
Loading…
Reference in a new issue