@@ -216,7 +216,9 @@ func postArtwork(ctx context.Context, bot *telego.Bot, query telego.CallbackQuer
216
216
})
217
217
return
218
218
}
219
- dataID := strings .Split (query .Data , " " )[2 ]
219
+ queryDataSlice := strings .Split (query .Data , " " )
220
+ asR18 := queryDataSlice [0 ] == "post_artwork_r18"
221
+ dataID := queryDataSlice [1 ]
220
222
sourceURL , err := service .GetCallbackDataByID (ctx , dataID )
221
223
if err != nil {
222
224
bot .AnswerCallbackQuery (& telego.AnswerCallbackQueryParams {
@@ -279,6 +281,9 @@ func postArtwork(ctx context.Context, bot *telego.Bot, query telego.CallbackQuer
279
281
return
280
282
}
281
283
}
284
+ if asR18 {
285
+ artwork .R18 = true
286
+ }
282
287
if err := fetcher .PostAndCreateArtwork (ctx , artwork , bot , storage .GetStorage (), query .From .ID ); err != nil {
283
288
Logger .Errorf ("发布失败: %s" , err )
284
289
go bot .EditMessageCaption (& telego.EditMessageCaptionParams {
@@ -305,7 +310,7 @@ func postArtwork(ctx context.Context, bot *telego.Bot, query telego.CallbackQuer
305
310
Caption : "发布成功: " + artwork .Title + "\n \n 发布时间: " + artwork .CreatedAt .Format ("2006-01-02 15:04:05" ),
306
311
ReplyMarkup : telegoutil .InlineKeyboard (
307
312
[]telego.InlineKeyboardButton {
308
- telegoutil .InlineKeyboardButton ("去查看 " ).WithURL (telegram .GetArtworkPostMessageURL (artwork .Pictures [0 ].TelegramInfo .MessageID )),
313
+ telegoutil .InlineKeyboardButton ("查看 " ).WithURL (telegram .GetArtworkPostMessageURL (artwork .Pictures [0 ].TelegramInfo .MessageID )),
309
314
telegoutil .InlineKeyboardButton ("原图" ).WithURL (telegram .GetDeepLinkForFile (artwork .Pictures [0 ].TelegramInfo .MessageID )),
310
315
},
311
316
),
0 commit comments