mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2025-06-03 09:56:45 +08:00
update all test
This commit is contained in:
parent
e7a2ab43a8
commit
8d40ba504c
2
bot.py
2
bot.py
@ -12,4 +12,4 @@ nonebot.load_builtin_plugins("echo")
|
||||
nonebot.load_plugins("src/plugins")
|
||||
|
||||
if __name__ == "__main__":
|
||||
nonebot.run(app="bot:app")
|
||||
nonebot.run()
|
||||
|
@ -15,3 +15,4 @@ from . import (
|
||||
__help__version__ = "0.4.3"
|
||||
__help__plugin__name__ = "nonebot_bison"
|
||||
__usage__ = "本bot可以提供b站、微博等社交媒体的消息订阅,详情" "请查看本bot文档,或者at本bot发送“添加订阅”订阅第一个帐号"
|
||||
__module_name__ = "nonebot-bison"
|
||||
|
@ -12,7 +12,7 @@ from .platform import platform_manager
|
||||
from .plugin_config import plugin_config
|
||||
from .send import send_msgs, do_send_msgs
|
||||
|
||||
scheduler = AsyncIOScheduler()
|
||||
scheduler = AsyncIOScheduler(timezone="Asia/Shanghai")
|
||||
|
||||
|
||||
@get_driver().on_startup
|
||||
|
@ -219,3 +219,4 @@ if plugin_config.bison_filter_log:
|
||||
if config.log_level is None
|
||||
else config.log_level
|
||||
)
|
||||
logger.warning("test")
|
||||
|
@ -1,36 +1,23 @@
|
||||
import typing
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
import nonebot
|
||||
from nonebug.fixture import nonebug_init, nonebug_clear
|
||||
|
||||
if typing.TYPE_CHECKING:
|
||||
import sys
|
||||
|
||||
sys.path.append("./src/plugins")
|
||||
import nonebot_bison
|
||||
|
||||
|
||||
@pytest.fixture # (scope="module")
|
||||
def plugin_module(tmpdir):
|
||||
nonebot.init(bison_config_path=str(tmpdir))
|
||||
nonebot.load_plugins("src/plugins")
|
||||
plugins = nonebot.get_loaded_plugins()
|
||||
plugin = list(filter(lambda x: x.name == "nonebot_bison", plugins))[0]
|
||||
return plugin.module
|
||||
from nonebug.app import App
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def dummy_user_subinfo(plugin_module: "nonebot_bison"):
|
||||
user = plugin_module.types.User("123", "group")
|
||||
return plugin_module.types.UserSubInfo(
|
||||
user=user, category_getter=lambda _: [], tag_getter=lambda _: []
|
||||
)
|
||||
async def app(nonebug_init: None, tmp_path: Path, monkeypatch: pytest.MonkeyPatch):
|
||||
import nonebot
|
||||
|
||||
config = nonebot.get_driver().config
|
||||
config.bison_config_path = str(tmp_path)
|
||||
return App(monkeypatch)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def n_plugin_module(tmpdir):
|
||||
nonebot.init(bison_config_path=str(tmpdir))
|
||||
nonebot.load_plugins("src/plugins")
|
||||
yield None
|
||||
nonebug_clear()
|
||||
def dummy_user_subinfo(app: App):
|
||||
from nonebot_bison.types import User, UserSubInfo
|
||||
|
||||
user = User("123", "group")
|
||||
return UserSubInfo(user=user, category_getter=lambda _: [], tag_getter=lambda _: [])
|
||||
|
@ -1,21 +1,16 @@
|
||||
import typing
|
||||
|
||||
import respx
|
||||
import pytest
|
||||
from httpx import Response
|
||||
|
||||
if typing.TYPE_CHECKING:
|
||||
import sys
|
||||
|
||||
sys.path.append("./src/plugins")
|
||||
import nonebot_bison
|
||||
from nonebug.app import App
|
||||
|
||||
from .utils import get_file, get_json
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def arknights(plugin_module: "nonebot_bison"):
|
||||
return plugin_module.platform.platform_manager["arknights"]
|
||||
def arknights(app: App):
|
||||
from nonebot_bison.platform import platform_manager
|
||||
|
||||
return platform_manager["arknights"]
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
|
@ -1,13 +1,6 @@
|
||||
import typing
|
||||
|
||||
import pytest
|
||||
from httpx import Response
|
||||
|
||||
if typing.TYPE_CHECKING:
|
||||
import sys
|
||||
|
||||
sys.path.append("./src/plugins")
|
||||
import nonebot_bison
|
||||
from nonebug.app import App
|
||||
|
||||
from .utils import get_json
|
||||
|
||||
@ -18,8 +11,10 @@ def bing_dy_list():
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def bilibili(plugin_module: "nonebot_bison"):
|
||||
return plugin_module.platform.platform_manager["bilibili"]
|
||||
def bilibili(app: App):
|
||||
from nonebot_bison.platform import platform_manager
|
||||
|
||||
return platform_manager["bilibili"]
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
@ -1,22 +1,18 @@
|
||||
import time
|
||||
import typing
|
||||
|
||||
import respx
|
||||
import pytest
|
||||
from httpx import Response
|
||||
from nonebug.app import App
|
||||
|
||||
from .utils import get_json
|
||||
|
||||
if typing.TYPE_CHECKING:
|
||||
import sys
|
||||
|
||||
sys.path.append("./src/plugins")
|
||||
import nonebot_bison
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def ncm_artist(plugin_module: "nonebot_bison"):
|
||||
return plugin_module.platform.platform_manager["ncm-artist"]
|
||||
def ncm_artist(app: App):
|
||||
from nonebot_bison.platform import platform_manager
|
||||
|
||||
return platform_manager["ncm-artist"]
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
|
@ -1,22 +1,18 @@
|
||||
import time
|
||||
import typing
|
||||
|
||||
import respx
|
||||
import pytest
|
||||
from httpx import Response
|
||||
from nonebug.app import App
|
||||
|
||||
from .utils import get_json
|
||||
|
||||
if typing.TYPE_CHECKING:
|
||||
import sys
|
||||
|
||||
sys.path.append("./src/plugins")
|
||||
import nonebot_bison
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def ncm_radio(plugin_module: "nonebot_bison"):
|
||||
return plugin_module.platform.platform_manager["ncm-radio"]
|
||||
def ncm_radio(app: App):
|
||||
from nonebot_bison.platform import platform_manager
|
||||
|
||||
return platform_manager["ncm-radio"]
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
|
@ -1,18 +1,8 @@
|
||||
import sys
|
||||
import typing
|
||||
from time import time
|
||||
from typing import Any, Optional
|
||||
|
||||
import pytest
|
||||
|
||||
if typing.TYPE_CHECKING:
|
||||
import sys
|
||||
|
||||
sys.path.append("./src/plugins")
|
||||
import nonebot_bison
|
||||
from nonebot_bison.types import *
|
||||
from nonebot_bison.post import Post
|
||||
|
||||
from time import time
|
||||
from nonebug.app import App
|
||||
|
||||
now = time()
|
||||
passed = now - 3 * 60 * 60
|
||||
@ -29,22 +19,30 @@ raw_post_list_2 = raw_post_list_1 + [
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def dummy_user(plugin_module: "nonebot_bison"):
|
||||
user = plugin_module.types.User("123", "group")
|
||||
def dummy_user(app: App):
|
||||
from nonebot_bison.types import User
|
||||
|
||||
user = User("123", "group")
|
||||
return user
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def user_info_factory(plugin_module: "nonebot_bison", dummy_user):
|
||||
def user_info_factory(app: App, dummy_user):
|
||||
from nonebot_bison.types import UserSubInfo
|
||||
|
||||
def _user_info(category_getter, tag_getter):
|
||||
return plugin_module.types.UserSubInfo(dummy_user, category_getter, tag_getter)
|
||||
return UserSubInfo(dummy_user, category_getter, tag_getter)
|
||||
|
||||
return _user_info
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_platform_without_cats_tags(plugin_module: "nonebot_bison"):
|
||||
class MockPlatform(plugin_module.platform.platform.NewMessage):
|
||||
def mock_platform_without_cats_tags(app: App):
|
||||
from nonebot_bison.post import Post
|
||||
from nonebot_bison.types import Target, RawPost
|
||||
from nonebot_bison.platform.platform import NewMessage
|
||||
|
||||
class MockPlatform(NewMessage):
|
||||
|
||||
platform_name = "mock_platform"
|
||||
name = "Mock Platform"
|
||||
@ -70,7 +68,7 @@ def mock_platform_without_cats_tags(plugin_module: "nonebot_bison"):
|
||||
return raw_post["date"]
|
||||
|
||||
async def parse(self, raw_post: "RawPost") -> "Post":
|
||||
return plugin_module.post.Post(
|
||||
return Post(
|
||||
"mock_platform",
|
||||
raw_post["text"],
|
||||
"http://t.tt/" + str(self.get_id(raw_post)),
|
||||
@ -88,8 +86,12 @@ def mock_platform_without_cats_tags(plugin_module: "nonebot_bison"):
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_platform(plugin_module: "nonebot_bison"):
|
||||
class MockPlatform(plugin_module.platform.platform.NewMessage):
|
||||
def mock_platform(app: App):
|
||||
from nonebot_bison.post import Post
|
||||
from nonebot_bison.platform.platform import NewMessage
|
||||
from nonebot_bison.types import Tag, Target, RawPost, Category
|
||||
|
||||
class MockPlatform(NewMessage):
|
||||
|
||||
platform_name = "mock_platform"
|
||||
name = "Mock Platform"
|
||||
@ -99,8 +101,8 @@ def mock_platform(plugin_module: "nonebot_bison"):
|
||||
enable_tag = True
|
||||
has_target = True
|
||||
categories = {
|
||||
1: "转发",
|
||||
2: "视频",
|
||||
Category(1): "转发",
|
||||
Category(2): "视频",
|
||||
}
|
||||
|
||||
def __init__(self):
|
||||
@ -124,7 +126,7 @@ def mock_platform(plugin_module: "nonebot_bison"):
|
||||
return raw_post["category"]
|
||||
|
||||
async def parse(self, raw_post: "RawPost") -> "Post":
|
||||
return plugin_module.post.Post(
|
||||
return Post(
|
||||
"mock_platform",
|
||||
raw_post["text"],
|
||||
"http://t.tt/" + str(self.get_id(raw_post)),
|
||||
@ -142,8 +144,12 @@ def mock_platform(plugin_module: "nonebot_bison"):
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_platform_no_target(plugin_module: "nonebot_bison"):
|
||||
class MockPlatform(plugin_module.platform.platform.NewMessage):
|
||||
def mock_platform_no_target(app: App):
|
||||
from nonebot_bison.post import Post
|
||||
from nonebot_bison.types import Tag, Target, RawPost, Category
|
||||
from nonebot_bison.platform.platform import NewMessage, CategoryNotSupport
|
||||
|
||||
class MockPlatform(NewMessage):
|
||||
|
||||
platform_name = "mock_platform"
|
||||
name = "Mock Platform"
|
||||
@ -153,7 +159,7 @@ def mock_platform_no_target(plugin_module: "nonebot_bison"):
|
||||
schedule_kw = {"seconds": 30}
|
||||
enable_tag = True
|
||||
has_target = False
|
||||
categories = {1: "转发", 2: "视频", 3: "不支持"}
|
||||
categories = {Category(1): "转发", Category(2): "视频", Category(3): "不支持"}
|
||||
|
||||
def __init__(self):
|
||||
self.sub_index = 0
|
||||
@ -174,11 +180,11 @@ def mock_platform_no_target(plugin_module: "nonebot_bison"):
|
||||
|
||||
def get_category(self, raw_post: "RawPost") -> "Category":
|
||||
if raw_post["category"] == 3:
|
||||
raise plugin_module.platform.platform.CategoryNotSupport()
|
||||
raise CategoryNotSupport()
|
||||
return raw_post["category"]
|
||||
|
||||
async def parse(self, raw_post: "RawPost") -> "Post":
|
||||
return plugin_module.post.Post(
|
||||
return Post(
|
||||
"mock_platform",
|
||||
raw_post["text"],
|
||||
"http://t.tt/" + str(self.get_id(raw_post)),
|
||||
@ -196,8 +202,12 @@ def mock_platform_no_target(plugin_module: "nonebot_bison"):
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_platform_no_target_2(plugin_module: "nonebot_bison"):
|
||||
class MockPlatform(plugin_module.platform.platform.NewMessage):
|
||||
def mock_platform_no_target_2(app: App):
|
||||
from nonebot_bison.post import Post
|
||||
from nonebot_bison.platform.platform import NewMessage
|
||||
from nonebot_bison.types import Tag, Target, RawPost, Category
|
||||
|
||||
class MockPlatform(NewMessage):
|
||||
|
||||
platform_name = "mock_platform"
|
||||
name = "Mock Platform"
|
||||
@ -208,8 +218,8 @@ def mock_platform_no_target_2(plugin_module: "nonebot_bison"):
|
||||
enable_tag = True
|
||||
has_target = False
|
||||
categories = {
|
||||
4: "leixing4",
|
||||
5: "leixing5",
|
||||
Category(4): "leixing4",
|
||||
Category(5): "leixing5",
|
||||
}
|
||||
|
||||
def __init__(self):
|
||||
@ -233,7 +243,7 @@ def mock_platform_no_target_2(plugin_module: "nonebot_bison"):
|
||||
return raw_post["category"]
|
||||
|
||||
async def parse(self, raw_post: "RawPost") -> "Post":
|
||||
return plugin_module.post.Post(
|
||||
return Post(
|
||||
"mock_platform_2",
|
||||
raw_post["text"],
|
||||
"http://t.tt/" + str(self.get_id(raw_post)),
|
||||
@ -259,8 +269,12 @@ def mock_platform_no_target_2(plugin_module: "nonebot_bison"):
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_status_change(plugin_module: "nonebot_bison"):
|
||||
class MockPlatform(plugin_module.platform.platform.StatusChange):
|
||||
def mock_status_change(app: App):
|
||||
from nonebot_bison.post import Post
|
||||
from nonebot_bison.platform.platform import StatusChange
|
||||
from nonebot_bison.types import Tag, Target, RawPost, Category
|
||||
|
||||
class MockPlatform(StatusChange):
|
||||
|
||||
platform_name = "mock_platform"
|
||||
name = "Mock Platform"
|
||||
@ -271,8 +285,8 @@ def mock_status_change(plugin_module: "nonebot_bison"):
|
||||
schedule_kw = {"seconds": 10}
|
||||
has_target = False
|
||||
categories = {
|
||||
1: "转发",
|
||||
2: "视频",
|
||||
Category(1): "转发",
|
||||
Category(2): "视频",
|
||||
}
|
||||
|
||||
def __init__(self):
|
||||
@ -297,7 +311,7 @@ def mock_status_change(plugin_module: "nonebot_bison"):
|
||||
return []
|
||||
|
||||
async def parse(self, raw_post) -> "Post":
|
||||
return plugin_module.post.Post("mock_status", raw_post["text"], "")
|
||||
return Post("mock_status", raw_post["text"], "")
|
||||
|
||||
def get_category(self, raw_post):
|
||||
return raw_post["cat"]
|
||||
@ -420,14 +434,17 @@ async def test_status_change(mock_status_change, user_info_factory):
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_group(
|
||||
plugin_module: "nonebot_bison",
|
||||
app: App,
|
||||
mock_platform_no_target,
|
||||
mock_platform_no_target_2,
|
||||
user_info_factory,
|
||||
):
|
||||
group_platform = plugin_module.platform.platform.NoTargetGroup(
|
||||
[mock_platform_no_target, mock_platform_no_target_2]
|
||||
)
|
||||
|
||||
from nonebot_bison.post import Post
|
||||
from nonebot_bison.platform.platform import NoTargetGroup
|
||||
from nonebot_bison.types import Tag, Target, RawPost, Category
|
||||
|
||||
group_platform = NoTargetGroup([mock_platform_no_target, mock_platform_no_target_2])
|
||||
res1 = await group_platform.fetch_new_post(
|
||||
"dummy", [user_info_factory(lambda _: [1, 4], lambda _: [])]
|
||||
)
|
||||
|
@ -1,4 +1,3 @@
|
||||
import typing
|
||||
from datetime import datetime
|
||||
|
||||
import respx
|
||||
@ -6,19 +5,16 @@ import pytest
|
||||
import feedparser
|
||||
from pytz import timezone
|
||||
from httpx import Response
|
||||
|
||||
if typing.TYPE_CHECKING:
|
||||
import sys
|
||||
|
||||
sys.path.append("./src/plugins")
|
||||
import nonebot_bison
|
||||
from nonebug.app import App
|
||||
|
||||
from .utils import get_file, get_json
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def weibo(plugin_module: "nonebot_bison"):
|
||||
return plugin_module.platform.platform_manager["weibo"]
|
||||
def weibo(app: App):
|
||||
from nonebot_bison.platform import platform_manager
|
||||
|
||||
return platform_manager["weibo"]
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
|
@ -1,7 +1,7 @@
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
path = Path(__file__).parent
|
||||
path = Path(__file__).parent / "static"
|
||||
|
||||
|
||||
def get_json(file_name: str):
|
||||
|
@ -1,23 +1,28 @@
|
||||
import typing
|
||||
|
||||
import pytest
|
||||
from nonebug.app import App
|
||||
|
||||
if typing.TYPE_CHECKING:
|
||||
import sys
|
||||
|
||||
sys.path.append("./src/plugins")
|
||||
import nonebot_bison
|
||||
from nonebot_bison.config import Config
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def config(plugin_module):
|
||||
plugin_module.config.start_up()
|
||||
return plugin_module.config.Config()
|
||||
def config(app: App):
|
||||
from nonebot_bison import config
|
||||
|
||||
config.start_up()
|
||||
return config.Config()
|
||||
|
||||
|
||||
def test_create_and_get(
|
||||
config: "nonebot_bison.config.Config", plugin_module: "nonebot_bison"
|
||||
):
|
||||
def test_create_and_get(config: "Config", app: App):
|
||||
from nonebot_bison import types
|
||||
from nonebot_bison.types import Target
|
||||
|
||||
config.add_subscribe(
|
||||
user="123",
|
||||
user_type="group",
|
||||
@ -29,8 +34,8 @@ def test_create_and_get(
|
||||
)
|
||||
confs = config.list_subscribe("123", "group")
|
||||
assert len(confs) == 1
|
||||
assert config.target_user_cache["weibo"]["weibo_id"] == [
|
||||
plugin_module.types.User("123", "group")
|
||||
assert config.target_user_cache["weibo"][Target("weibo_id")] == [
|
||||
types.User("123", "group")
|
||||
]
|
||||
assert confs[0]["cats"] == []
|
||||
config.update_subscribe(
|
||||
|
@ -1,6 +1,7 @@
|
||||
import typing
|
||||
|
||||
import pytest
|
||||
from nonebug.app import App
|
||||
|
||||
if typing.TYPE_CHECKING:
|
||||
import sys
|
||||
@ -40,48 +41,56 @@ merge_source_9_2 = [
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_9_merge(plugin_module: "nonebot_bison"):
|
||||
post = plugin_module.post.Post("", "", "", pics=merge_source_9)
|
||||
async def test_9_merge(app: App):
|
||||
from nonebot_bison.post import Post
|
||||
|
||||
post = Post("", "", "", pics=merge_source_9)
|
||||
await post._pic_merge()
|
||||
assert len(post.pics) == 5
|
||||
await post.generate_messages()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_9_merge_2(plugin_module: "nonebot_bison"):
|
||||
post = plugin_module.post.Post("", "", "", pics=merge_source_9_2)
|
||||
async def test_9_merge_2(app: App):
|
||||
from nonebot_bison.post import Post
|
||||
|
||||
post = Post("", "", "", pics=merge_source_9_2)
|
||||
await post._pic_merge()
|
||||
assert len(post.pics) == 4
|
||||
await post.generate_messages()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_6_merge(plugin_module):
|
||||
post = plugin_module.post.Post(
|
||||
"", "", "", pics=merge_source_9[0:6] + merge_source_9[9:]
|
||||
)
|
||||
async def test_6_merge(app: App):
|
||||
from nonebot_bison.post import Post
|
||||
|
||||
post = Post("", "", "", pics=merge_source_9[0:6] + merge_source_9[9:])
|
||||
await post._pic_merge()
|
||||
assert len(post.pics) == 5
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_3_merge(plugin_module):
|
||||
post = plugin_module.post.Post(
|
||||
"", "", "", pics=merge_source_9[0:3] + merge_source_9[9:]
|
||||
)
|
||||
async def test_3_merge(app: App):
|
||||
from nonebot_bison.post import Post
|
||||
|
||||
post = Post("", "", "", pics=merge_source_9[0:3] + merge_source_9[9:])
|
||||
await post._pic_merge()
|
||||
assert len(post.pics) == 5
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_6_merge_only(plugin_module):
|
||||
post = plugin_module.post.Post("", "", "", pics=merge_source_9[0:6])
|
||||
async def test_6_merge_only(app: App):
|
||||
from nonebot_bison.post import Post
|
||||
|
||||
post = Post("", "", "", pics=merge_source_9[0:6])
|
||||
await post._pic_merge()
|
||||
assert len(post.pics) == 1
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_3_merge_only(plugin_module):
|
||||
post = plugin_module.post.Post("", "", "", pics=merge_source_9[0:3])
|
||||
async def test_3_merge_only(app: App):
|
||||
from nonebot_bison.post import Post
|
||||
|
||||
post = Post("", "", "", pics=merge_source_9[0:3])
|
||||
await post._pic_merge()
|
||||
assert len(post.pics) == 1
|
||||
|
@ -1,16 +0,0 @@
|
||||
import pytest
|
||||
|
||||
|
||||
def test_add(n_plugin_module):
|
||||
from nonebot_bison.config import Config
|
||||
|
||||
config = Config()
|
||||
config.add_subscribe(
|
||||
user="123",
|
||||
user_type="group",
|
||||
target="weibo_id",
|
||||
target_name="weibo_name",
|
||||
target_type="weibo",
|
||||
cats=[],
|
||||
tags=[],
|
||||
)
|
@ -1,6 +1,7 @@
|
||||
import typing
|
||||
|
||||
import pytest
|
||||
from nonebug.app import App
|
||||
|
||||
if typing.TYPE_CHECKING:
|
||||
import sys
|
||||
@ -11,8 +12,10 @@ if typing.TYPE_CHECKING:
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.render
|
||||
async def test_render(plugin_module: "nonebot_bison"):
|
||||
render = plugin_module.utils.Render()
|
||||
async def test_render(app: App):
|
||||
from nonebot_bison.utils import Render
|
||||
|
||||
render = Render()
|
||||
res = await render.text_to_pic(
|
||||
"""a\nbbbbbbbbbbbbbbbbbbbbbb\ncd
|
||||
<h1>中文</h1>
|
||||
|
Loading…
x
Reference in New Issue
Block a user