1234567891011121314151617181920212223242526272829303132333435363738 |
- package api
- import (
- "fmt"
- "github.com/gorilla/websocket"
- )
- func (conn *WsBot) Upload_group_file(group_id int, file string, name string, folder string) error {
- err := conn.Wsconn.WriteMessage(websocket.TextMessage,
- []byte(fmt.Sprintf(`
- {
- "action":"upload_group_file",
- "params":{
- "group_id":%d,
- "file":"%s",
- "name":"%s",
- "folder":"%s"
- }
- }
- `, group_id, file, name, folder)))
- return err
- }
- func (conn *WsBot) Upload_private_file(user_id int, file string, name string) error {
- err := conn.Wsconn.WriteMessage(websocket.TextMessage,
- []byte(fmt.Sprintf(`
- {
- "action":"upload_private_file",
- "params":{
- "user_id":%d,
- "file":"%s",
- "name":"%s",
- }
- }
- `, user_id, file, name)))
- return err
- }
|