ZeroBot-Plugin/plugin/bilibili/card2msg_test.go
himawari 8c24194772
添加AI视频总结 (#787)
*  添加AI视频总结

* 🐛 添加空格

* 🎨 修改文本格式
2023-10-15 00:23:52 +09:00

64 lines
1.1 KiB
Go

package bilibili
import (
"testing"
bz "github.com/FloatTech/AnimeAPI/bilibili"
)
func TestArticleInfo(t *testing.T) {
card, err := bz.GetArticleInfo("17279244")
if err != nil {
t.Fatal(err)
}
t.Log(articleCard2msg(card, "17279244"))
}
func TestMemberCard(t *testing.T) {
card, err := bz.GetMemberCard(2)
if err != nil {
t.Fatal(err)
}
t.Logf("%+v\n", card)
}
func TestVideoInfo(t *testing.T) {
card, err := bz.GetVideoInfo("10007")
if err != nil {
t.Fatal(err)
}
t.Log(videoCard2msg(card))
card, err = bz.GetVideoInfo("BV1xx411c7mD")
if err != nil {
t.Fatal(err)
}
t.Log(videoCard2msg(card))
card, err = bz.GetVideoInfo("bv1xx411c7mD")
if err != nil {
t.Fatal(err)
}
t.Log(videoCard2msg(card))
card, err = bz.GetVideoInfo("BV1mF411j7iU")
if err != nil {
t.Fatal(err)
}
t.Log(videoCard2msg(card))
}
func TestGetVideoSummary(t *testing.T) {
card, err := bz.GetVideoInfo("BV1mF411j7iU")
if err != nil {
t.Fatal(err)
}
t.Log(getVideoSummary(card))
}
func TestLiveRoomInfo(t *testing.T) {
card, err := bz.GetLiveRoomInfo("83171")
if err != nil {
t.Fatal(err)
}
t.Log(liveCard2msg(card))
}