@@ -19,8 +19,8 @@ import (
1919 "github.com/LagrangeDev/LagrangeGo/client/entity"
2020 "github.com/LagrangeDev/LagrangeGo/client/sign"
2121 "github.com/LagrangeDev/LagrangeGo/message"
22- "github.com/LagrangeDev/LagrangeGo/utils"
2322 "github.com/LagrangeDev/LagrangeGo/utils/binary"
23+ "github.com/LagrangeDev/LagrangeGo/utils/io"
2424 log "github.com/sirupsen/logrus"
2525 "github.com/tidwall/gjson"
2626
@@ -272,7 +272,7 @@ func (bot *CQBot) CQUploadGroupFile(groupID int64, file, name, folder string) gl
272272 log .Warnf ("上传群文件 %v 失败: 文件不存在" , file )
273273 return Failed (100 , "FILE_NOT_FOUND" , "文件不存在" )
274274 }
275- if err := bot .Client .SendGroupFile (uint32 (groupID ), file , name , utils .Ternary (folder == "" , "/" , folder )); err != nil {
275+ if err := bot .Client .SendGroupFile (uint32 (groupID ), file , name , io .Ternary (folder == "" , "/" , folder )); err != nil {
276276 log .Warnf ("上传群 %v 文件 %v 失败: %v" , groupID , file , err )
277277 return Failed (100 , "FILE_SYSTEM_UPLOAD_API_ERROR" , err .Error ())
278278 }
@@ -837,9 +837,9 @@ func (bot *CQBot) CQProcessGroupRequest(flag, subType, reason string, approve bo
837837 return Failed (100 , "FLAG_HAS_BEEN_CHECKED" , "消息已被处理" )
838838 }
839839 if approve {
840- _ = bot .Client .SetGroupRequest (req .IsFiltered , true , req .Sequence , uint32 (req .EventType ), req .GroupUin , "" )
840+ _ = bot .Client .SetGroupRequest (req .IsFiltered , entity . GroupRequestOperateAllow , req .Sequence , uint32 (req .EventType ), req .GroupUin , "" )
841841 } else {
842- _ = bot .Client .SetGroupRequest (req .IsFiltered , false , req .Sequence , uint32 (req .EventType ), req .GroupUin , reason )
842+ _ = bot .Client .SetGroupRequest (req .IsFiltered , entity . GroupRequestOperateDeny , req .Sequence , uint32 (req .EventType ), req .GroupUin , reason )
843843 }
844844 return OK (nil )
845845 }
@@ -852,9 +852,9 @@ func (bot *CQBot) CQProcessGroupRequest(flag, subType, reason string, approve bo
852852 return Failed (100 , "FLAG_HAS_BEEN_CHECKED" , "消息已被处理" )
853853 }
854854 if approve {
855- _ = bot .Client .SetGroupRequest (req .IsFiltered , true , req .Sequence , uint32 (req .EventType ), req .GroupUin , "" )
855+ _ = bot .Client .SetGroupRequest (req .IsFiltered , entity . GroupRequestOperateAllow , req .Sequence , uint32 (req .EventType ), req .GroupUin , "" )
856856 } else {
857- _ = bot .Client .SetGroupRequest (req .IsFiltered , false , req .Sequence , uint32 (req .EventType ), req .GroupUin , reason )
857+ _ = bot .Client .SetGroupRequest (req .IsFiltered , entity . GroupRequestOperateDeny , req .Sequence , uint32 (req .EventType ), req .GroupUin , reason )
858858 }
859859 return OK (nil )
860860 }
@@ -1057,7 +1057,7 @@ func (bot *CQBot) CQHandleQuickOperation(context, operation gjson.Result) global
10571057 },
10581058 })
10591059
1060- err := json .Unmarshal (utils .S2B (reply .Raw ), & replySegments )
1060+ err := json .Unmarshal (io .S2B (reply .Raw ), & replySegments )
10611061 if err != nil {
10621062 log .WithError (err ).Warnf ("处理 at_sender 过程中发生错误" )
10631063 return Failed (- 1 , "处理 at_sender 过程中发生错误" , err .Error ())
@@ -1071,7 +1071,7 @@ func (bot *CQBot) CQHandleQuickOperation(context, operation gjson.Result) global
10711071 return Failed (- 1 , "处理 at_sender 过程中发生错误" , err .Error ())
10721072 }
10731073
1074- reply = gjson .Parse (utils .B2S (modified ))
1074+ reply = gjson .Parse (io .B2S (modified ))
10751075 } else if at && reply .Type == gjson .String {
10761076 reply = gjson .Parse (fmt .Sprintf (
10771077 "\" [CQ:at,qq=%d]%s\" " ,
@@ -1141,11 +1141,12 @@ func (bot *CQBot) CQGetImage(file string) global.MSG {
11411141
11421142 if err == nil {
11431143 r := binary .NewReader (b )
1144- r .ReadBytes (16 )
1144+ r .SkipBytes (16 )
11451145 msg := global.MSG {
11461146 "size" : r .ReadI32 (),
11471147 "filename" : r .ReadStringWithLength ("u32" , true ),
11481148 "url" : r .ReadStringWithLength ("u32" , true ),
1149+ "fileuuid" : r .ReadStringWithLength ("u32" , true ),
11491150 }
11501151 local := path .Join (global .CachePath , file + path .Ext (msg ["filename" ].(string )))
11511152 if ! global .FileExists (local ) {
0 commit comments