@@ -10,6 +10,7 @@ import (
1010 tgba "github.com/go-telegram-bot-api/telegram-bot-api/v5"
1111
1212 fbctxext "github.com/FloatTech/floatbox/ctxext"
13+ "github.com/FloatTech/floatbox/web"
1314 ctrl "github.com/FloatTech/zbpctrl"
1415
1516 "github.com/FloatTech/ReiBot-Plugin/utils/ctxext"
@@ -59,6 +60,11 @@ func init() { // 插件主体
5960 i = rand .Intn (len (mcnPic ))
6061 pic = mcnPic [i ]
6162 }
63+ data , err := web .RequestDataWith (web .NewTLS12Client (), pic .String (), "GET" , "http://hs.heisiwu.com/" , web .RandUA (), nil )
64+ if err != nil {
65+ _ , _ = ctx .SendPlainMessage (false , "ERROR: " , err )
66+ return
67+ }
6268 _ , _ = ctx .Caller .Send (& tgba.PhotoConfig {
6369 BaseFile : tgba.BaseFile {
6470 BaseChat : tgba.BaseChat {
@@ -72,7 +78,7 @@ func init() { // 插件主体
7278 ),
7379 ),
7480 },
75- File : tgba .FileURL ( pic . String ()) ,
81+ File : tgba.FileBytes { Bytes : data } ,
7682 },
7783 })
7884 })
@@ -99,13 +105,18 @@ func init() { // 插件主体
99105 case "网红" :
100106 pic = mcnPic [i ]
101107 }
108+ data , err := web .RequestDataWith (web .NewTLS12Client (), pic .String (), "GET" , "http://hs.heisiwu.com/" , web .RandUA (), nil )
109+ if err != nil {
110+ _ , _ = ctx .Caller .Send (tgba .NewCallbackWithAlert (ctx .Value .(* tgba.CallbackQuery ).ID , "ERROR: " + err .Error ()))
111+ return
112+ }
102113 _ , err = ctx .Caller .Send (& tgba.DocumentConfig {
103114 BaseFile : tgba.BaseFile {
104115 BaseChat : tgba.BaseChat {
105116 ChatID : ctx .Message .Chat .ID ,
106117 ReplyToMessageID : ctx .Message .MessageID ,
107118 },
108- File : tgba .FileURL ( pic . String ()) ,
119+ File : tgba.FileBytes { Bytes : data } ,
109120 },
110121 })
111122 if err != nil {
0 commit comments