mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
fix: port main branch changes to channel subpackages after rebase
Port changes that were applied to the old pkg/channels/*.go files on main to their new locations in channel subpackages: - telegram: precompile regex, var transcribedText, GetModelName() - discord: var transcribedText declaration - onebot: resp.Body.Close(), "canceled" spelling, remove empty line - slack: named return values in parseSlackChatID - wecom: remove sendMarkdownMessage dead code - whatsapp: resp.Body.Close() after Dial - gateway/helpers: remove unused errors import
This commit is contained in:
@@ -172,7 +172,10 @@ func (c *OneBotChannel) connect() error {
|
||||
header["Authorization"] = []string{"Bearer " + c.config.AccessToken}
|
||||
}
|
||||
|
||||
conn, _, err := dialer.Dial(c.config.WSUrl, header)
|
||||
conn, resp, err := dialer.Dial(c.config.WSUrl, header)
|
||||
if resp != nil {
|
||||
resp.Body.Close()
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -313,7 +316,7 @@ func (c *OneBotChannel) sendAPIRequest(action string, params any, timeout time.D
|
||||
case <-time.After(timeout):
|
||||
return nil, fmt.Errorf("API request %s timed out after %v", action, timeout)
|
||||
case <-c.ctx.Done():
|
||||
return nil, fmt.Errorf("context cancelled")
|
||||
return nil, fmt.Errorf("context canceled")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -815,7 +818,6 @@ func (c *OneBotChannel) parseMessageSegments(
|
||||
textParts = append(textParts, "[forward message]")
|
||||
|
||||
default:
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user