|
|
|
@ -1304,6 +1304,13 @@ func (c *Client) returnMessage(returnJid string, chatID int64, text string, code
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *Client) returnError(returnJid string, chatID int64, msg string, err error, code int, isGroupchat bool) {
|
|
|
|
|
responseError, ok := err.(client.ResponseError)
|
|
|
|
|
log.Debugf("responseError: %#v", responseError)
|
|
|
|
|
if ok && responseError.Err != nil {
|
|
|
|
|
if responseError.Err.Message == "Have no write access to the chat" {
|
|
|
|
|
code = 403
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
c.returnMessage(returnJid, chatID, fmt.Sprintf("%s: %s", msg, err.Error()), code, isGroupchat)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|