mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2025-07-15 04:33:01 +08:00
👷 添加ruff actions
🐛 分支应该是main而不是master 💄 auto fix by pre-commit hooks 🔥 dependabot.yml的registrys需要token,先删除
This commit is contained in:
parent
7d4eb7785c
commit
e50eb5d70b
@ -79,7 +79,7 @@ workflows:
|
||||
context:
|
||||
- docker
|
||||
image: $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME
|
||||
cache_from: '$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:${CIRCLE_TAG}'
|
||||
cache_from: "$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:${CIRCLE_TAG}"
|
||||
tag: latest,${CIRCLE_TAG}
|
||||
update-description: true
|
||||
docker-username: DOCKERHUB_USERNAME
|
||||
@ -91,13 +91,13 @@ workflows:
|
||||
tags:
|
||||
ignore: /.*/
|
||||
tag: ${CIRCLE_BRANCH//\//-}
|
||||
cache_from: '$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:${CIRCLE_BRANCH}'
|
||||
cache_from: "$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:${CIRCLE_BRANCH}"
|
||||
- docker/publish:
|
||||
<<: *docker-push
|
||||
dockerfile: docker/Dockerfile_with_frontend_sentry
|
||||
name: "docker/publish-sentry"
|
||||
tag: sentry,${CIRCLE_TAG//\//-}-sentry
|
||||
cache_from: '$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:sentry'
|
||||
cache_from: "$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:sentry"
|
||||
- docker/publish:
|
||||
<<: *docker-push
|
||||
name: "docker/publish-debug-sentry"
|
||||
@ -108,7 +108,7 @@ workflows:
|
||||
tags:
|
||||
ignore: /.*/
|
||||
tag: ${CIRCLE_BRANCH//\//-}-sentry
|
||||
cache_from: '$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:${CIRCLE_BRANCH}-sentry'
|
||||
cache_from: "$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:${CIRCLE_BRANCH}-sentry"
|
||||
|
||||
jobs:
|
||||
build-frontend:
|
||||
@ -164,7 +164,8 @@ jobs:
|
||||
# command: poetry run playwright install-deps && poetry run playwright install chromium
|
||||
- run:
|
||||
name: Coverage test
|
||||
command: poetry run pytest --cov-report html --cov-report xml --cov=./src/plugins/nonebot_bison --junitxml=test-results/junit.xml
|
||||
command:
|
||||
poetry run pytest --cov-report html --cov-report xml --cov=./src/plugins/nonebot_bison --junitxml=test-results/junit.xml
|
||||
-k 'not compare and not render'
|
||||
- store_test_results:
|
||||
path: test-results
|
||||
@ -215,4 +216,3 @@ jobs:
|
||||
go install github.com/tcnksm/ghr@latest
|
||||
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} \
|
||||
-delete ${CIRCLE_TAG} -n ${CIRCLE_TAG} -b $(git log --format=%B -n 1 $CIRCLE_SHA1) ./dist
|
||||
|
||||
|
1
.github/actions/setup-python/action.yml
vendored
1
.github/actions/setup-python/action.yml
vendored
@ -18,4 +18,3 @@ runs:
|
||||
uses: Gr1N/setup-poetry@v8
|
||||
with:
|
||||
poetry-version: "1.3.2"
|
||||
|
||||
|
2
.github/actions/test-docker/action.yml
vendored
2
.github/actions/test-docker/action.yml
vendored
@ -8,7 +8,7 @@ inputs:
|
||||
wait-time:
|
||||
description: how many seconds to wait for
|
||||
required: true
|
||||
default: '5'
|
||||
default: "5"
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
|
9
.github/dependabot.yml
vendored
9
.github/dependabot.yml
vendored
@ -4,10 +4,6 @@
|
||||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||
|
||||
version: 2
|
||||
registries:
|
||||
npm-npmjs:
|
||||
type: npm-registry
|
||||
url: "https://registry.npmmirror.com"
|
||||
updates:
|
||||
- package-ecosystem: "pip" # See documentation for possible values
|
||||
directory: "/" # Location of package manifests
|
||||
@ -21,4 +17,7 @@ updates:
|
||||
directory: "/admin-frontend/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
|
||||
- package-ecosystem: github-actions
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: weekly
|
||||
|
2
.github/workflows/release-drafter.yml
vendored
2
.github/workflows/release-drafter.yml
vendored
@ -26,7 +26,7 @@ jobs:
|
||||
uses: docker://ghcr.io/nonebot/auto-changelog:master
|
||||
with:
|
||||
latest_changes_position: '# Change Log\n\n'
|
||||
latest_changes_title: '## 最近更新'
|
||||
latest_changes_title: "## 最近更新"
|
||||
replace_regex: '(?<=## 最近更新\n)[\s\S]*?(?=\n## )'
|
||||
changelog_body: ${{ steps.release-drafter.outputs.body }}
|
||||
commit_and_push: false
|
||||
|
1
.github/workflows/release.yml
vendored
1
.github/workflows/release.yml
vendored
@ -54,7 +54,6 @@ jobs:
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
|
||||
publish-docker:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build-frontend
|
||||
|
22
.github/workflows/ruff.yml
vendored
Normal file
22
.github/workflows/ruff.yml
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
name: Ruff Lint
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
paths:
|
||||
- "nonebot_bison/**"
|
||||
- "extra_plugins/**"
|
||||
- "tests/**"
|
||||
- "bot.py"
|
||||
|
||||
jobs:
|
||||
ruff:
|
||||
name: Ruff Lint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Run Ruff Lint
|
||||
uses: chartboost/ruff-action@v1
|
@ -1,4 +1,4 @@
|
||||
version: '3'
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
go-cqhttp:
|
||||
@ -15,8 +15,8 @@ services:
|
||||
# SUPERUSERS: '[<your QQ>]'
|
||||
BISON_CONFIG_PATH: /data
|
||||
# BISON_OUTER_URL: 'http://<your server ip>:8080/bison'
|
||||
BISON_FILTER_LOG: 'true'
|
||||
BISON_USE_PIC: 'false' # 如果需要将文字转为图片发送请改为true
|
||||
BISON_FILTER_LOG: "true"
|
||||
BISON_USE_PIC: "false" # 如果需要将文字转为图片发送请改为true
|
||||
ports:
|
||||
- 8080:8080
|
||||
depends_on:
|
||||
|
@ -1,21 +1,19 @@
|
||||
from typing import Union
|
||||
|
||||
from nonebot import on_request
|
||||
from nonebot.adapters.onebot.v11 import Bot
|
||||
from nonebot.adapters.onebot.v11.event import FriendRequestEvent, GroupRequestEvent
|
||||
from nonebot.log import logger
|
||||
from nonebot.adapters.onebot.v11 import Bot
|
||||
from nonebot.adapters.onebot.v11.event import GroupRequestEvent, FriendRequestEvent
|
||||
|
||||
friend_req = on_request(priority=5)
|
||||
|
||||
|
||||
@friend_req.handle()
|
||||
async def add_superuser(bot: Bot, event: Union[GroupRequestEvent, FriendRequestEvent]):
|
||||
async def add_superuser(bot: Bot, event: GroupRequestEvent | FriendRequestEvent):
|
||||
if str(event.user_id) not in bot.config.superusers:
|
||||
return
|
||||
|
||||
if isinstance(event, FriendRequestEvent):
|
||||
await event.approve(bot)
|
||||
logger.info("add user {}".format(event.user_id))
|
||||
logger.info(f"add user {event.user_id}")
|
||||
else:
|
||||
await event.approve(bot)
|
||||
logger.info("add group {}".format(event.group_id))
|
||||
logger.info(f"add group {event.group_id}")
|
||||
|
@ -1,6 +1,6 @@
|
||||
from .platform import platform_manager
|
||||
from .scheduler import scheduler_dict
|
||||
from .types import Target
|
||||
from .scheduler import scheduler_dict
|
||||
from .platform import platform_manager
|
||||
|
||||
|
||||
async def check_sub_target(platform_name: str, target: Target):
|
||||
|
@ -1,10 +1,10 @@
|
||||
from nonebot.log import logger
|
||||
from nonebot_plugin_datastore.db import get_engine, post_db_init, pre_db_init
|
||||
from sqlalchemy import inspect, text
|
||||
from sqlalchemy import text, inspect
|
||||
from nonebot_plugin_datastore.db import get_engine, pre_db_init, post_db_init
|
||||
|
||||
from .config.config_legacy import start_up as legacy_db_startup
|
||||
from .config.db_migration import data_migrate
|
||||
from .scheduler.manager import init_scheduler
|
||||
from .config.config_legacy import start_up as legacy_db_startup
|
||||
|
||||
|
||||
@pre_db_init
|
||||
@ -35,9 +35,7 @@ async def pre():
|
||||
if await conn.run_sync(_has_table, "nonebot_bison_alembic_version"):
|
||||
await conn.execute(text("drop table nonebot_bison_alembic_version"))
|
||||
|
||||
await conn.execute(
|
||||
text("alter table alembic_version rename to nonebot_bison_alembic_version")
|
||||
)
|
||||
await conn.execute(text("alter table alembic_version rename to nonebot_bison_alembic_version"))
|
||||
|
||||
|
||||
@post_db_init
|
||||
|
@ -1,13 +1,13 @@
|
||||
import datetime
|
||||
from pathlib import Path
|
||||
|
||||
from nonebot_plugin_datastore import get_plugin_data
|
||||
from nonebot_plugin_saa.utils import PlatformTarget
|
||||
from sqlalchemy import JSON, ForeignKey, String, UniqueConstraint
|
||||
from sqlalchemy.dialects.postgresql import JSONB
|
||||
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
from nonebot_plugin_saa.utils import PlatformTarget
|
||||
from nonebot_plugin_datastore import get_plugin_data
|
||||
from sqlalchemy.orm import Mapped, relationship, mapped_column
|
||||
from sqlalchemy import JSON, String, ForeignKey, UniqueConstraint
|
||||
|
||||
from ..types import Category, Tag
|
||||
from ..types import Tag, Category
|
||||
|
||||
Model = get_plugin_data().Model
|
||||
get_plugin_data().set_migration_dir(Path(__file__).parent / "migrations")
|
||||
@ -25,9 +25,7 @@ class User(Model):
|
||||
|
||||
|
||||
class Target(Model):
|
||||
__table_args__ = (
|
||||
UniqueConstraint("target", "platform_name", name="unique-target-constraint"),
|
||||
)
|
||||
__table_args__ = (UniqueConstraint("target", "platform_name", name="unique-target-constraint"),)
|
||||
|
||||
id: Mapped[int] = mapped_column(primary_key=True)
|
||||
platform_name: Mapped[str] = mapped_column(String(20))
|
||||
@ -36,9 +34,7 @@ class Target(Model):
|
||||
default_schedule_weight: Mapped[int] = mapped_column(default=10)
|
||||
|
||||
subscribes: Mapped[list["Subscribe"]] = relationship(back_populates="target")
|
||||
time_weight: Mapped[list["ScheduleTimeWeight"]] = relationship(
|
||||
back_populates="target"
|
||||
)
|
||||
time_weight: Mapped[list["ScheduleTimeWeight"]] = relationship(back_populates="target")
|
||||
|
||||
|
||||
class ScheduleTimeWeight(Model):
|
||||
@ -55,9 +51,7 @@ class ScheduleTimeWeight(Model):
|
||||
|
||||
|
||||
class Subscribe(Model):
|
||||
__table_args__ = (
|
||||
UniqueConstraint("target_id", "user_id", name="unique-subscribe-constraint"),
|
||||
)
|
||||
__table_args__ = (UniqueConstraint("target_id", "user_id", name="unique-subscribe-constraint"),)
|
||||
|
||||
id: Mapped[int] = mapped_column(primary_key=True)
|
||||
target_id: Mapped[int] = mapped_column(ForeignKey("nonebot_bison_target.id"))
|
||||
|
@ -31,9 +31,7 @@ def upgrade():
|
||||
sa.PrimaryKeyConstraint("id"),
|
||||
)
|
||||
with op.batch_alter_table("target", schema=None) as batch_op:
|
||||
batch_op.add_column(
|
||||
sa.Column("default_schedule_weight", sa.Integer(), nullable=True)
|
||||
)
|
||||
batch_op.add_column(sa.Column("default_schedule_weight", sa.Integer(), nullable=True))
|
||||
batch_op.drop_column("last_schedule_time")
|
||||
|
||||
# ### end Alembic commands ###
|
||||
@ -42,9 +40,7 @@ def upgrade():
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table("target", schema=None) as batch_op:
|
||||
batch_op.add_column(
|
||||
sa.Column("last_schedule_time", sa.DATETIME(), nullable=True)
|
||||
)
|
||||
batch_op.add_column(sa.Column("last_schedule_time", sa.DATETIME(), nullable=True))
|
||||
batch_op.drop_column("default_schedule_weight")
|
||||
|
||||
op.drop_table("schedule_time_weight")
|
||||
|
@ -18,9 +18,7 @@ depends_on = None
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table("target", schema=None) as batch_op:
|
||||
batch_op.add_column(
|
||||
sa.Column("last_schedule_time", sa.DateTime(timezone=True), nullable=True)
|
||||
)
|
||||
batch_op.add_column(sa.Column("last_schedule_time", sa.DateTime(timezone=True), nullable=True))
|
||||
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
@ -7,8 +7,8 @@ Create Date: 2023-03-20 01:14:42.623789
|
||||
"""
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
from sqlalchemy.ext.automap import automap_base
|
||||
from sqlalchemy.orm import Session
|
||||
from sqlalchemy.ext.automap import automap_base
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "a5466912fad0"
|
||||
|
@ -17,9 +17,7 @@ depends_on = None
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table(
|
||||
"nonebot_bison_scheduletimeweight", schema=None
|
||||
) as batch_op:
|
||||
with op.batch_alter_table("nonebot_bison_scheduletimeweight", schema=None) as batch_op:
|
||||
batch_op.alter_column("target_id", existing_type=sa.INTEGER(), nullable=False)
|
||||
batch_op.alter_column("start_time", existing_type=sa.TIME(), nullable=False)
|
||||
batch_op.alter_column("end_time", existing_type=sa.TIME(), nullable=False)
|
||||
@ -30,9 +28,7 @@ def upgrade() -> None:
|
||||
batch_op.alter_column("user_id", existing_type=sa.INTEGER(), nullable=False)
|
||||
|
||||
with op.batch_alter_table("nonebot_bison_target", schema=None) as batch_op:
|
||||
batch_op.alter_column(
|
||||
"default_schedule_weight", existing_type=sa.INTEGER(), nullable=False
|
||||
)
|
||||
batch_op.alter_column("default_schedule_weight", existing_type=sa.INTEGER(), nullable=False)
|
||||
|
||||
# ### end Alembic commands ###
|
||||
|
||||
@ -40,17 +36,13 @@ def upgrade() -> None:
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table("nonebot_bison_target", schema=None) as batch_op:
|
||||
batch_op.alter_column(
|
||||
"default_schedule_weight", existing_type=sa.INTEGER(), nullable=True
|
||||
)
|
||||
batch_op.alter_column("default_schedule_weight", existing_type=sa.INTEGER(), nullable=True)
|
||||
|
||||
with op.batch_alter_table("nonebot_bison_subscribe", schema=None) as batch_op:
|
||||
batch_op.alter_column("user_id", existing_type=sa.INTEGER(), nullable=True)
|
||||
batch_op.alter_column("target_id", existing_type=sa.INTEGER(), nullable=True)
|
||||
|
||||
with op.batch_alter_table(
|
||||
"nonebot_bison_scheduletimeweight", schema=None
|
||||
) as batch_op:
|
||||
with op.batch_alter_table("nonebot_bison_scheduletimeweight", schema=None) as batch_op:
|
||||
batch_op.alter_column("weight", existing_type=sa.INTEGER(), nullable=True)
|
||||
batch_op.alter_column("end_time", existing_type=sa.TIME(), nullable=True)
|
||||
batch_op.alter_column("start_time", existing_type=sa.TIME(), nullable=True)
|
||||
|
@ -8,8 +8,8 @@ Create Date: 2023-03-02 14:04:16.492133
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
from sqlalchemy import select
|
||||
from sqlalchemy.ext.automap import automap_base
|
||||
from sqlalchemy.orm import Session
|
||||
from sqlalchemy.ext.automap import automap_base
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "bd92923c218f"
|
||||
|
@ -1,16 +1,16 @@
|
||||
""" nbesf is Nonebot Bison Enchangable Subscribes File! ver.1"""
|
||||
|
||||
from functools import partial
|
||||
from typing import Any
|
||||
from functools import partial
|
||||
|
||||
from nonebot.log import logger
|
||||
from nonebot_plugin_saa import TargetQQGroup, TargetQQPrivate
|
||||
from pydantic import BaseModel
|
||||
from nonebot_plugin_saa import TargetQQGroup, TargetQQPrivate
|
||||
|
||||
from ....types import Category, Tag
|
||||
from ...db_config import SubscribeDupException, config
|
||||
from ..utils import NBESFParseErr
|
||||
from ....types import Tag, Category
|
||||
from .base import NBESFBase, SubReceipt
|
||||
from ...db_config import SubscribeDupException, config
|
||||
|
||||
# ===== nbesf 定义格式 ====== #
|
||||
NBESF_VERSION = 1
|
||||
@ -65,7 +65,6 @@ class SubGroup(
|
||||
|
||||
async def subs_receipt_gen(nbesf_data: SubGroup):
|
||||
for item in nbesf_data.groups:
|
||||
|
||||
match item.user.type:
|
||||
case "group":
|
||||
user = TargetQQGroup(group_id=item.user.uid)
|
||||
@ -85,9 +84,7 @@ async def subs_receipt_gen(nbesf_data: SubGroup):
|
||||
tags=sub.tags,
|
||||
)
|
||||
try:
|
||||
await config.add_subscribe(
|
||||
receipt.user, **receipt.dict(exclude={"user"})
|
||||
)
|
||||
await config.add_subscribe(receipt.user, **receipt.dict(exclude={"user"}))
|
||||
except SubscribeDupException:
|
||||
logger.warning(f"!添加订阅条目 {repr(receipt)} 失败: 相同的订阅已存在")
|
||||
except Exception as e:
|
||||
|
@ -1,16 +1,16 @@
|
||||
""" nbesf is Nonebot Bison Enchangable Subscribes File! ver.2"""
|
||||
|
||||
from functools import partial
|
||||
from typing import Any
|
||||
from functools import partial
|
||||
|
||||
from nonebot.log import logger
|
||||
from nonebot_plugin_saa.utils import AllSupportedPlatformTarget
|
||||
from pydantic import BaseModel
|
||||
from nonebot_plugin_saa.utils import AllSupportedPlatformTarget
|
||||
|
||||
from ....types import Category, Tag
|
||||
from ...db_config import SubscribeDupException, config
|
||||
from ..utils import NBESFParseErr
|
||||
from ....types import Tag, Category
|
||||
from .base import NBESFBase, SubReceipt
|
||||
from ...db_config import SubscribeDupException, config
|
||||
|
||||
# ===== nbesf 定义格式 ====== #
|
||||
NBESF_VERSION = 2
|
||||
@ -57,7 +57,6 @@ class SubGroup(NBESFBase):
|
||||
|
||||
async def subs_receipt_gen(nbesf_data: SubGroup):
|
||||
for item in nbesf_data.groups:
|
||||
|
||||
sub_receipt = partial(SubReceipt, user=item.user_target)
|
||||
|
||||
for sub in item.subs:
|
||||
@ -69,9 +68,7 @@ async def subs_receipt_gen(nbesf_data: SubGroup):
|
||||
tags=sub.tags,
|
||||
)
|
||||
try:
|
||||
await config.add_subscribe(
|
||||
receipt.user, **receipt.dict(exclude={"user"})
|
||||
)
|
||||
await config.add_subscribe(receipt.user, **receipt.dict(exclude={"user"}))
|
||||
except SubscribeDupException:
|
||||
logger.warning(f"!添加订阅条目 {repr(receipt)} 失败: 相同的订阅已存在")
|
||||
except Exception as e:
|
||||
|
@ -2,25 +2,19 @@ import asyncio
|
||||
from datetime import datetime
|
||||
|
||||
from nonebot import on_command
|
||||
from nonebot.typing import T_State
|
||||
from nonebot.matcher import Matcher
|
||||
from nonebot.rule import Rule, to_me
|
||||
from nonebot.permission import SUPERUSER
|
||||
from nonebot_plugin_saa import TargetQQGroup
|
||||
from nonebot.params import ArgStr, ArgPlainText
|
||||
from nonebot.adapters import Bot, MessageTemplate
|
||||
from nonebot.adapters.onebot.v11.event import PrivateMessageEvent
|
||||
from nonebot.matcher import Matcher
|
||||
from nonebot.params import ArgPlainText, ArgStr
|
||||
from nonebot.permission import SUPERUSER
|
||||
from nonebot.rule import Rule, to_me
|
||||
from nonebot.typing import T_State
|
||||
from nonebot_plugin_saa import TargetQQGroup
|
||||
|
||||
from .add_sub import do_add_sub
|
||||
from .del_sub import do_del_sub
|
||||
from .query_sub import do_query_sub
|
||||
from .utils import (
|
||||
admin_permission,
|
||||
common_platform,
|
||||
configurable_to_me,
|
||||
gen_handle_cancel,
|
||||
set_target_user_info,
|
||||
)
|
||||
from .utils import common_platform, admin_permission, gen_handle_cancel, configurable_to_me, set_target_user_info
|
||||
|
||||
add_sub_matcher = on_command(
|
||||
"添加订阅",
|
||||
@ -48,9 +42,7 @@ del_sub_matcher = on_command(
|
||||
del_sub_matcher.handle()(set_target_user_info)
|
||||
do_del_sub(del_sub_matcher)
|
||||
|
||||
group_manage_matcher = on_command(
|
||||
"群管理", rule=to_me(), permission=SUPERUSER, priority=4, block=True
|
||||
)
|
||||
group_manage_matcher = on_command("群管理", rule=to_me(), permission=SUPERUSER, priority=4, block=True)
|
||||
|
||||
group_handle_cancel = gen_handle_cancel(group_manage_matcher, "已取消")
|
||||
|
||||
@ -69,12 +61,8 @@ async def send_group_list(bot: Bot, event: PrivateMessageEvent, state: T_State):
|
||||
state["group_number_idx"] = group_number_idx
|
||||
|
||||
|
||||
@group_manage_matcher.got(
|
||||
"group_idx", MessageTemplate("{_prompt}"), [group_handle_cancel]
|
||||
)
|
||||
async def do_choose_group_number(
|
||||
state: T_State, event: PrivateMessageEvent, group_idx: str = ArgPlainText()
|
||||
):
|
||||
@group_manage_matcher.got("group_idx", MessageTemplate("{_prompt}"), [group_handle_cancel])
|
||||
async def do_choose_group_number(state: T_State, event: PrivateMessageEvent, group_idx: str = ArgPlainText()):
|
||||
group_number_idx: dict[int, int] = state["group_number_idx"]
|
||||
assert group_number_idx
|
||||
idx = int(group_idx)
|
||||
@ -87,9 +75,7 @@ async def do_choose_group_number(
|
||||
state["target_user_info"] = TargetQQGroup(group_id=group_id)
|
||||
|
||||
|
||||
@group_manage_matcher.got(
|
||||
"command", "请输入需要使用的命令:添加订阅,查询订阅,删除订阅,取消", [group_handle_cancel]
|
||||
)
|
||||
@group_manage_matcher.got("command", "请输入需要使用的命令:添加订阅,查询订阅,删除订阅,取消", [group_handle_cancel])
|
||||
async def do_dispatch_command(
|
||||
bot: Bot,
|
||||
event: PrivateMessageEvent,
|
||||
|
@ -1,10 +1,10 @@
|
||||
from dataclasses import dataclass
|
||||
from datetime import time
|
||||
from typing import Any, Literal, NamedTuple, NewType
|
||||
from dataclasses import dataclass
|
||||
from typing import Any, Literal, NewType, NamedTuple
|
||||
|
||||
from httpx import URL
|
||||
from nonebot_plugin_saa import PlatformTarget as SendTarget
|
||||
from pydantic import BaseModel
|
||||
from nonebot_plugin_saa import PlatformTarget as SendTarget
|
||||
|
||||
RawPost = Any
|
||||
Target = NewType("Target", str)
|
||||
|
@ -1,11 +1,11 @@
|
||||
""" 提供获取 Bot 的方法 """
|
||||
from collections import defaultdict
|
||||
from typing import Any
|
||||
from collections import defaultdict
|
||||
|
||||
import nonebot
|
||||
from nonebot.adapters import Bot
|
||||
from nonebot.adapters.onebot.v11 import Bot as Ob11Bot
|
||||
from nonebot_plugin_saa import PlatformTarget
|
||||
from nonebot.adapters.onebot.v11 import Bot as Ob11Bot
|
||||
|
||||
GROUP: dict[int, list[Bot]] = {}
|
||||
USER: dict[int, list[Bot]] = {}
|
||||
@ -28,12 +28,6 @@ async def get_groups() -> list[dict[str, Any]]:
|
||||
all_groups: dict[int, dict[str, Any]] = {}
|
||||
for bot in get_bots():
|
||||
groups = await bot.get_group_list()
|
||||
all_groups.update(
|
||||
{
|
||||
group["group_id"]: group
|
||||
for group in groups
|
||||
if group["group_id"] not in all_groups
|
||||
}
|
||||
)
|
||||
all_groups.update({group["group_id"]: group for group in groups if group["group_id"] not in all_groups})
|
||||
|
||||
return list(all_groups.values())
|
||||
|
1689
pnpm-lock.yaml
generated
1689
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -3,14 +3,14 @@ from nonebug.app import App
|
||||
|
||||
|
||||
async def test_add_subscribe(app: App, init_scheduler):
|
||||
from nonebot_plugin_datastore.db import get_engine
|
||||
from nonebot_plugin_saa import TargetQQGroup
|
||||
from sqlalchemy.ext.asyncio.session import AsyncSession
|
||||
from sqlalchemy.sql.expression import select
|
||||
from nonebot_plugin_datastore.db import get_engine
|
||||
from sqlalchemy.ext.asyncio.session import AsyncSession
|
||||
|
||||
from nonebot_bison.config.db_config import config
|
||||
from nonebot_bison.config.db_model import Subscribe, Target, User
|
||||
from nonebot_bison.types import Target as TTarget
|
||||
from nonebot_bison.config.db_model import User, Target, Subscribe
|
||||
|
||||
await config.add_subscribe(
|
||||
TargetQQGroup(group_id=123),
|
||||
@ -32,12 +32,8 @@ async def test_add_subscribe(app: App, init_scheduler):
|
||||
assert len(confs) == 1
|
||||
conf: Subscribe = confs[0]
|
||||
async with AsyncSession(get_engine()) as sess:
|
||||
related_user_obj = await sess.scalar(
|
||||
select(User).where(User.id == conf.user_id)
|
||||
)
|
||||
related_target_obj = await sess.scalar(
|
||||
select(Target).where(Target.id == conf.target_id)
|
||||
)
|
||||
related_user_obj = await sess.scalar(select(User).where(User.id == conf.user_id))
|
||||
related_target_obj = await sess.scalar(select(Target).where(Target.id == conf.target_id))
|
||||
assert related_user_obj
|
||||
assert related_target_obj
|
||||
assert related_user_obj.user_target["group_id"] == 123
|
||||
@ -58,12 +54,8 @@ async def test_add_subscribe(app: App, init_scheduler):
|
||||
assert len(confs) == 1
|
||||
conf: Subscribe = confs[0]
|
||||
async with AsyncSession(get_engine()) as sess:
|
||||
related_user_obj = await sess.scalar(
|
||||
select(User).where(User.id == conf.user_id)
|
||||
)
|
||||
related_target_obj = await sess.scalar(
|
||||
select(Target).where(Target.id == conf.target_id)
|
||||
)
|
||||
related_user_obj = await sess.scalar(select(User).where(User.id == conf.user_id))
|
||||
related_target_obj = await sess.scalar(select(Target).where(Target.id == conf.target_id))
|
||||
assert related_user_obj
|
||||
assert related_target_obj
|
||||
assert related_user_obj.user_target["group_id"] == 123
|
||||
@ -77,8 +69,8 @@ async def test_add_subscribe(app: App, init_scheduler):
|
||||
async def test_add_dup_sub(init_scheduler):
|
||||
from nonebot_plugin_saa import TargetQQGroup
|
||||
|
||||
from nonebot_bison.config.db_config import SubscribeDupException, config
|
||||
from nonebot_bison.types import Target as TTarget
|
||||
from nonebot_bison.config.db_config import SubscribeDupException, config
|
||||
|
||||
await config.add_subscribe(
|
||||
TargetQQGroup(group_id=123),
|
||||
@ -101,15 +93,15 @@ async def test_add_dup_sub(init_scheduler):
|
||||
|
||||
|
||||
async def test_del_subsribe(init_scheduler):
|
||||
from nonebot_plugin_datastore.db import get_engine
|
||||
from nonebot_plugin_saa import TargetQQGroup
|
||||
from sqlalchemy.ext.asyncio.session import AsyncSession
|
||||
from sqlalchemy.sql.expression import select
|
||||
from sqlalchemy.sql.functions import func
|
||||
from nonebot_plugin_saa import TargetQQGroup
|
||||
from sqlalchemy.sql.expression import select
|
||||
from nonebot_plugin_datastore.db import get_engine
|
||||
from sqlalchemy.ext.asyncio.session import AsyncSession
|
||||
|
||||
from nonebot_bison.config.db_config import config
|
||||
from nonebot_bison.config.db_model import Subscribe, Target
|
||||
from nonebot_bison.types import Target as TTarget
|
||||
from nonebot_bison.config.db_model import Target, Subscribe
|
||||
|
||||
await config.add_subscribe(
|
||||
TargetQQGroup(group_id=123),
|
||||
|
@ -1,9 +1,9 @@
|
||||
async def test_migration(use_legacy_config):
|
||||
from nonebot_plugin_datastore.db import init_db
|
||||
from nonebot_plugin_saa import TargetQQGroup
|
||||
from nonebot_plugin_datastore.db import init_db
|
||||
|
||||
from nonebot_bison.config.config_legacy import Config
|
||||
from nonebot_bison.config.db_config import config
|
||||
from nonebot_bison.config.config_legacy import Config
|
||||
|
||||
config_legacy = Config()
|
||||
config_legacy.add_subscribe(
|
||||
@ -57,11 +57,11 @@ async def test_migration(use_legacy_config):
|
||||
|
||||
|
||||
async def test_migrate_dup(use_legacy_config):
|
||||
from nonebot_plugin_datastore.db import init_db
|
||||
from nonebot_plugin_saa import TargetQQGroup
|
||||
from nonebot_plugin_datastore.db import init_db
|
||||
|
||||
from nonebot_bison.config.config_legacy import Config
|
||||
from nonebot_bison.config.db_config import config
|
||||
from nonebot_bison.config.config_legacy import Config
|
||||
|
||||
config_legacy = Config()
|
||||
config_legacy.add_subscribe(
|
||||
|
@ -1 +1,6 @@
|
||||
{"actived":true,"preAnnounceId":280,"preAnnounceType":2,"preAnnounceUrl":"https://ak-fs.hypergryph.com/announce/Android/preannouncement/280.html"}
|
||||
{
|
||||
"actived": true,
|
||||
"preAnnounceId": 280,
|
||||
"preAnnounceType": 2,
|
||||
"preAnnounceUrl": "https://ak-fs.hypergryph.com/announce/Android/preannouncement/280.html"
|
||||
}
|
||||
|
@ -88,4 +88,3 @@
|
||||
"name": "额外活动"
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1 +1,16 @@
|
||||
{"code":0,"message":"success","result":{"media":{"areas":[{"id":1,"name":"中国大陆"}],"cover":"http://i0.hdslb.com/bfs/bangumi/image/206428990cb5b54f4c114c0b3fcc10d8f5724f7c.jpg","media_id":28235413,"new_ep":{"id":519207,"index":"1","index_show":"更新至第2话"},"season_id":39719,"share_url":"https://www.bilibili.com/bangumi/media/md28235413","title":"汉化日记 第三季","type_name":"国创"}}}
|
||||
{
|
||||
"code": 0,
|
||||
"message": "success",
|
||||
"result": {
|
||||
"media": {
|
||||
"areas": [{ "id": 1, "name": "中国大陆" }],
|
||||
"cover": "http://i0.hdslb.com/bfs/bangumi/image/206428990cb5b54f4c114c0b3fcc10d8f5724f7c.jpg",
|
||||
"media_id": 28235413,
|
||||
"new_ep": { "id": 519207, "index": "1", "index_show": "更新至第2话" },
|
||||
"season_id": 39719,
|
||||
"share_url": "https://www.bilibili.com/bangumi/media/md28235413",
|
||||
"title": "汉化日记 第三季",
|
||||
"type_name": "国创"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -1 +1,16 @@
|
||||
{"code":0,"message":"success","result":{"media":{"areas":[{"id":1,"name":"中国大陆"}],"cover":"http://i0.hdslb.com/bfs/bangumi/image/206428990cb5b54f4c114c0b3fcc10d8f5724f7c.jpg","media_id":28235413,"new_ep":{"id":519207,"index":"2","index_show":"更新至第2话"},"season_id":39719,"share_url":"https://www.bilibili.com/bangumi/media/md28235413","title":"汉化日记 第三季","type_name":"国创"}}}
|
||||
{
|
||||
"code": 0,
|
||||
"message": "success",
|
||||
"result": {
|
||||
"media": {
|
||||
"areas": [{ "id": 1, "name": "中国大陆" }],
|
||||
"cover": "http://i0.hdslb.com/bfs/bangumi/image/206428990cb5b54f4c114c0b3fcc10d8f5724f7c.jpg",
|
||||
"media_id": 28235413,
|
||||
"new_ep": { "id": 519207, "index": "2", "index_show": "更新至第2话" },
|
||||
"season_id": 39719,
|
||||
"share_url": "https://www.bilibili.com/bangumi/media/md28235413",
|
||||
"title": "汉化日记 第三季",
|
||||
"type_name": "国创"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1 +1,94 @@
|
||||
{"code":0,"message":"0","ttl":1,"data":{"card":{"mid":"161775300","name":"明日方舟","approve":false,"sex":"保密","rank":"10000","face":"https://i0.hdslb.com/bfs/face/d4005a0f9b898d8bb049caf9c6355f8e8f772a8f.jpg","face_nft":0,"face_nft_type":0,"DisplayRank":"0","regtime":0,"spacesta":0,"birthday":"","place":"","description":"","article":0,"attentions":[],"fans":5421712,"friend":3,"attention":3,"sign":"重铸未来 方舟启航","level_info":{"current_level":6,"current_min":0,"current_exp":0,"next_exp":0},"pendant":{"pid":1990,"name":"明日方舟","image":"https://i0.hdslb.com/bfs/garb/item/0c8e7d627a35c378b757f39419889ef1fcc0ed9b.png","expire":0,"image_enhance":"https://i0.hdslb.com/bfs/garb/item/1815c81da71069ea3db4553cad7d233f782da2f2.webp","image_enhance_frame":"https://i0.hdslb.com/bfs/garb/item/ed2b4ef1da228c0b937753542b33af8f04d1d70c.png"},"nameplate":{"nid":0,"name":"","image":"","image_small":"","level":"","condition":""},"Official":{"role":3,"title":"明日方舟官方账号","desc":"","type":1},"official_verify":{"type":1,"desc":"明日方舟官方账号"},"vip":{"type":2,"status":1,"due_date":1715097600000,"vip_pay_type":0,"theme_type":0,"label":{"path":"","text":"年度大会员","label_theme":"annual_vip","text_color":"#FFFFFF","bg_style":1,"bg_color":"#FB7299","border_color":"","use_img_label":true,"img_label_uri_hans":"","img_label_uri_hant":"","img_label_uri_hans_static":"https://i0.hdslb.com/bfs/vip/8d4f8bfc713826a5412a0a27eaaac4d6b9ede1d9.png","img_label_uri_hant_static":"https://i0.hdslb.com/bfs/activity-plat/static/20220614/e369244d0b14644f5e1a06431e22a4d5/VEW8fCC0hg.png"},"avatar_subscript":1,"nickname_color":"#FB7299","role":3,"avatar_subscript_url":"","tv_vip_status":0,"tv_vip_pay_type":0,"tv_due_date":0,"vipType":2,"vipStatus":1},"is_senior_member":0},"following":false,"archive_count":282,"article_count":0,"follower":5421712,"like_num":83977549}}
|
||||
{
|
||||
"code": 0,
|
||||
"message": "0",
|
||||
"ttl": 1,
|
||||
"data": {
|
||||
"card": {
|
||||
"mid": "161775300",
|
||||
"name": "明日方舟",
|
||||
"approve": false,
|
||||
"sex": "保密",
|
||||
"rank": "10000",
|
||||
"face": "https://i0.hdslb.com/bfs/face/d4005a0f9b898d8bb049caf9c6355f8e8f772a8f.jpg",
|
||||
"face_nft": 0,
|
||||
"face_nft_type": 0,
|
||||
"DisplayRank": "0",
|
||||
"regtime": 0,
|
||||
"spacesta": 0,
|
||||
"birthday": "",
|
||||
"place": "",
|
||||
"description": "",
|
||||
"article": 0,
|
||||
"attentions": [],
|
||||
"fans": 5421712,
|
||||
"friend": 3,
|
||||
"attention": 3,
|
||||
"sign": "重铸未来 方舟启航",
|
||||
"level_info": {
|
||||
"current_level": 6,
|
||||
"current_min": 0,
|
||||
"current_exp": 0,
|
||||
"next_exp": 0
|
||||
},
|
||||
"pendant": {
|
||||
"pid": 1990,
|
||||
"name": "明日方舟",
|
||||
"image": "https://i0.hdslb.com/bfs/garb/item/0c8e7d627a35c378b757f39419889ef1fcc0ed9b.png",
|
||||
"expire": 0,
|
||||
"image_enhance": "https://i0.hdslb.com/bfs/garb/item/1815c81da71069ea3db4553cad7d233f782da2f2.webp",
|
||||
"image_enhance_frame": "https://i0.hdslb.com/bfs/garb/item/ed2b4ef1da228c0b937753542b33af8f04d1d70c.png"
|
||||
},
|
||||
"nameplate": {
|
||||
"nid": 0,
|
||||
"name": "",
|
||||
"image": "",
|
||||
"image_small": "",
|
||||
"level": "",
|
||||
"condition": ""
|
||||
},
|
||||
"Official": {
|
||||
"role": 3,
|
||||
"title": "明日方舟官方账号",
|
||||
"desc": "",
|
||||
"type": 1
|
||||
},
|
||||
"official_verify": { "type": 1, "desc": "明日方舟官方账号" },
|
||||
"vip": {
|
||||
"type": 2,
|
||||
"status": 1,
|
||||
"due_date": 1715097600000,
|
||||
"vip_pay_type": 0,
|
||||
"theme_type": 0,
|
||||
"label": {
|
||||
"path": "",
|
||||
"text": "年度大会员",
|
||||
"label_theme": "annual_vip",
|
||||
"text_color": "#FFFFFF",
|
||||
"bg_style": 1,
|
||||
"bg_color": "#FB7299",
|
||||
"border_color": "",
|
||||
"use_img_label": true,
|
||||
"img_label_uri_hans": "",
|
||||
"img_label_uri_hant": "",
|
||||
"img_label_uri_hans_static": "https://i0.hdslb.com/bfs/vip/8d4f8bfc713826a5412a0a27eaaac4d6b9ede1d9.png",
|
||||
"img_label_uri_hant_static": "https://i0.hdslb.com/bfs/activity-plat/static/20220614/e369244d0b14644f5e1a06431e22a4d5/VEW8fCC0hg.png"
|
||||
},
|
||||
"avatar_subscript": 1,
|
||||
"nickname_color": "#FB7299",
|
||||
"role": 3,
|
||||
"avatar_subscript_url": "",
|
||||
"tv_vip_status": 0,
|
||||
"tv_vip_pay_type": 0,
|
||||
"tv_due_date": 0,
|
||||
"vipType": 2,
|
||||
"vipStatus": 1
|
||||
},
|
||||
"is_senior_member": 0
|
||||
},
|
||||
"following": false,
|
||||
"archive_count": 282,
|
||||
"article_count": 0,
|
||||
"follower": 5421712,
|
||||
"like_num": 83977549
|
||||
}
|
||||
}
|
||||
|
85
tests/platforms/static/ff14-newdata-0.json
vendored
85
tests/platforms/static/ff14-newdata-0.json
vendored
@ -1 +1,84 @@
|
||||
{"Code":"0","Message":"","PageCount":293,"TotalCount":1465,"RecordCount":5,"Data":[{"Id":336868,"Articletype":3,"ApplicationCode":92,"CategoryCode":5310,"SortIndex":9,"GroupIndex":0,"TitleClass":"","Title":"LIVE番外:第68回制作人来信转播 2月19日上演","Summary":"第68回制作人来信将于2022年2月19日放送,届时FFXIV的制作人兼导演吉田直树将会以「FFXIV的全新挑战 ~面向下一个10年~」为话题为大家介绍今后的更新情报。","Author":"https://ff.web.sdo.com/web8/index.html#/newstab/newscont/336868","PublishDate":"2022/02/15 16:02:21","OutLink":"","HomeImagePath":"https://fu5.web.sdo.com/10036/202202/16448326143171.jpg"},{"Id":336969,"Articletype":3,"ApplicationCode":92,"CategoryCode":5310,"SortIndex":8,"GroupIndex":0,"TitleClass":"","Title":"群狼盛宴第20赛季对战数据查询开放","Summary":"群狼盛宴第20赛季对战数据查询开放。冒险现在可以在专题页面点击右上角的「对战数据查询」来查询第20赛季的总对战场次和胜利场次数据。","Author":"https://ff.web.sdo.com/web8/index.html#/newstab/newscont/336969","PublishDate":"2022/02/17 15:09:31","OutLink":"","HomeImagePath":"https://fu5.web.sdo.com/10036/202202/16450708307681.jpg"},{"Id":336870,"Articletype":3,"ApplicationCode":92,"CategoryCode":5310,"SortIndex":7,"GroupIndex":0,"TitleClass":"","Title":"最终幻想XIV 银质坠饰 <友谊永存>预售开启!","Summary":"最终幻想XIV 银质坠饰 <友谊永存>现已开启预售!","Author":"https://ff.web.sdo.com/web8/index.html#/newstab/newscont/336870","PublishDate":"2022/02/15 14:11:09","OutLink":"","HomeImagePath":"https://fu5.web.sdo.com/10036/202202/16448345978202.jpg"},{"Id":336869,"Articletype":3,"ApplicationCode":92,"CategoryCode":5312,"SortIndex":6,"GroupIndex":0,"TitleClass":"","Title":"2月22日「太阳海岸」、「伊修加德」服务器临时维护公告","Summary":"我们将于2月22日14:00-16:00对豆豆柴区进行临时维护。维护结束后将开启「太阳海岸」、「伊修加德」服务器个人及部队房屋购买功能。","Author":"https://ff.web.sdo.com/web8/index.html#/newstab/newscont/336869","PublishDate":"2022/02/15 16:17:13","OutLink":"","HomeImagePath":"https://fu5.web.sdo.com/10036/202202/16448330187049.jpg"},{"Id":336978,"Articletype":3,"ApplicationCode":92,"CategoryCode":5312,"SortIndex":5,"GroupIndex":0,"TitleClass":"","Title":"《最终幻想14》2月17日违规账号处罚公告","Summary":"为了更好地维护游戏内的游戏秩序,保障各位冒险者良好公正的游戏体验,近期我们对游戏中违反了游戏规定的账号进行了查处,封号名单已更新至违规处理平台中。","Author":"https://ff.web.sdo.com/web8/index.html#/newstab/newscont/336978","PublishDate":"2022/02/17 15:38:20","OutLink":"","HomeImagePath":"https://fu5.web.sdo.com/10036/202202/16450834782144.jpg"}]}
|
||||
{
|
||||
"Code": "0",
|
||||
"Message": "",
|
||||
"PageCount": 293,
|
||||
"TotalCount": 1465,
|
||||
"RecordCount": 5,
|
||||
"Data": [
|
||||
{
|
||||
"Id": 336868,
|
||||
"Articletype": 3,
|
||||
"ApplicationCode": 92,
|
||||
"CategoryCode": 5310,
|
||||
"SortIndex": 9,
|
||||
"GroupIndex": 0,
|
||||
"TitleClass": "",
|
||||
"Title": "LIVE番外:第68回制作人来信转播 2月19日上演",
|
||||
"Summary": "第68回制作人来信将于2022年2月19日放送,届时FFXIV的制作人兼导演吉田直树将会以「FFXIV的全新挑战 ~面向下一个10年~」为话题为大家介绍今后的更新情报。",
|
||||
"Author": "https://ff.web.sdo.com/web8/index.html#/newstab/newscont/336868",
|
||||
"PublishDate": "2022/02/15 16:02:21",
|
||||
"OutLink": "",
|
||||
"HomeImagePath": "https://fu5.web.sdo.com/10036/202202/16448326143171.jpg"
|
||||
},
|
||||
{
|
||||
"Id": 336969,
|
||||
"Articletype": 3,
|
||||
"ApplicationCode": 92,
|
||||
"CategoryCode": 5310,
|
||||
"SortIndex": 8,
|
||||
"GroupIndex": 0,
|
||||
"TitleClass": "",
|
||||
"Title": "群狼盛宴第20赛季对战数据查询开放",
|
||||
"Summary": "群狼盛宴第20赛季对战数据查询开放。冒险现在可以在专题页面点击右上角的「对战数据查询」来查询第20赛季的总对战场次和胜利场次数据。",
|
||||
"Author": "https://ff.web.sdo.com/web8/index.html#/newstab/newscont/336969",
|
||||
"PublishDate": "2022/02/17 15:09:31",
|
||||
"OutLink": "",
|
||||
"HomeImagePath": "https://fu5.web.sdo.com/10036/202202/16450708307681.jpg"
|
||||
},
|
||||
{
|
||||
"Id": 336870,
|
||||
"Articletype": 3,
|
||||
"ApplicationCode": 92,
|
||||
"CategoryCode": 5310,
|
||||
"SortIndex": 7,
|
||||
"GroupIndex": 0,
|
||||
"TitleClass": "",
|
||||
"Title": "最终幻想XIV 银质坠饰 <友谊永存>预售开启!",
|
||||
"Summary": "最终幻想XIV 银质坠饰 <友谊永存>现已开启预售!",
|
||||
"Author": "https://ff.web.sdo.com/web8/index.html#/newstab/newscont/336870",
|
||||
"PublishDate": "2022/02/15 14:11:09",
|
||||
"OutLink": "",
|
||||
"HomeImagePath": "https://fu5.web.sdo.com/10036/202202/16448345978202.jpg"
|
||||
},
|
||||
{
|
||||
"Id": 336869,
|
||||
"Articletype": 3,
|
||||
"ApplicationCode": 92,
|
||||
"CategoryCode": 5312,
|
||||
"SortIndex": 6,
|
||||
"GroupIndex": 0,
|
||||
"TitleClass": "",
|
||||
"Title": "2月22日「太阳海岸」、「伊修加德」服务器临时维护公告",
|
||||
"Summary": "我们将于2月22日14:00-16:00对豆豆柴区进行临时维护。维护结束后将开启「太阳海岸」、「伊修加德」服务器个人及部队房屋购买功能。",
|
||||
"Author": "https://ff.web.sdo.com/web8/index.html#/newstab/newscont/336869",
|
||||
"PublishDate": "2022/02/15 16:17:13",
|
||||
"OutLink": "",
|
||||
"HomeImagePath": "https://fu5.web.sdo.com/10036/202202/16448330187049.jpg"
|
||||
},
|
||||
{
|
||||
"Id": 336978,
|
||||
"Articletype": 3,
|
||||
"ApplicationCode": 92,
|
||||
"CategoryCode": 5312,
|
||||
"SortIndex": 5,
|
||||
"GroupIndex": 0,
|
||||
"TitleClass": "",
|
||||
"Title": "《最终幻想14》2月17日违规账号处罚公告",
|
||||
"Summary": "为了更好地维护游戏内的游戏秩序,保障各位冒险者良好公正的游戏体验,近期我们对游戏中违反了游戏规定的账号进行了查处,封号名单已更新至违规处理平台中。",
|
||||
"Author": "https://ff.web.sdo.com/web8/index.html#/newstab/newscont/336978",
|
||||
"PublishDate": "2022/02/17 15:38:20",
|
||||
"OutLink": "",
|
||||
"HomeImagePath": "https://fu5.web.sdo.com/10036/202202/16450834782144.jpg"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
85
tests/platforms/static/ff14-newdata-1.json
vendored
85
tests/platforms/static/ff14-newdata-1.json
vendored
@ -1 +1,84 @@
|
||||
{"Code":"0","Message":"","PageCount":293,"TotalCount":1465,"RecordCount":5,"Data":[{"Id":336868,"Articletype":3,"ApplicationCode":92,"CategoryCode":5310,"SortIndex":9,"GroupIndex":0,"TitleClass":"","Title":"LIVE番外:第68回制作人来信转播 2月19日上演","Summary":"第68回制作人来信将于2022年2月19日放送,届时FFXIV的制作人兼导演吉田直树将会以「FFXIV的全新挑战 ~面向下一个10年~」为话题为大家介绍今后的更新情报。","Author":"https://ff.web.sdo.com/web8/index.html#/newstab/newscont/336868","PublishDate":"2022/02/15 16:02:21","OutLink":"","HomeImagePath":"https://fu5.web.sdo.com/10036/202202/16448326143171.jpg"},{"Id":336969,"Articletype":3,"ApplicationCode":92,"CategoryCode":5310,"SortIndex":8,"GroupIndex":0,"TitleClass":"","Title":"群狼盛宴第20赛季对战数据查询开放","Summary":"群狼盛宴第20赛季对战数据查询开放。冒险现在可以在专题页面点击右上角的「对战数据查询」来查询第20赛季的总对战场次和胜利场次数据。","Author":"https://ff.web.sdo.com/web8/index.html#/newstab/newscont/336969","PublishDate":"2022/02/17 15:09:31","OutLink":"","HomeImagePath":"https://fu5.web.sdo.com/10036/202202/16450708307681.jpg"},{"Id":336870,"Articletype":3,"ApplicationCode":92,"CategoryCode":5310,"SortIndex":7,"GroupIndex":0,"TitleClass":"","Title":"最终幻想XIV 银质坠饰 <友谊永存>预售开启!","Summary":"最终幻想XIV 银质坠饰 <友谊永存>现已开启预售!","Author":"https://ff.web.sdo.com/web8/index.html#/newstab/newscont/336870","PublishDate":"2022/02/18 14:11:09","OutLink":"","HomeImagePath":"https://fu5.web.sdo.com/10036/202202/16448345978202.jpg"},{"Id":336869,"Articletype":3,"ApplicationCode":92,"CategoryCode":5312,"SortIndex":6,"GroupIndex":0,"TitleClass":"","Title":"2月22日「太阳海岸」、「伊修加德」服务器临时维护公告","Summary":"我们将于2月22日14:00-16:00对豆豆柴区进行临时维护。维护结束后将开启「太阳海岸」、「伊修加德」服务器个人及部队房屋购买功能。","Author":"https://ff.web.sdo.com/web8/index.html#/newstab/newscont/336869","PublishDate":"2022/02/15 16:17:13","OutLink":"","HomeImagePath":"https://fu5.web.sdo.com/10036/202202/16448330187049.jpg"},{"Id":336978,"Articletype":3,"ApplicationCode":92,"CategoryCode":5312,"SortIndex":5,"GroupIndex":0,"TitleClass":"","Title":"《最终幻想14》2月17日违规账号处罚公告","Summary":"为了更好地维护游戏内的游戏秩序,保障各位冒险者良好公正的游戏体验,近期我们对游戏中违反了游戏规定的账号进行了查处,封号名单已更新至违规处理平台中。","Author":"https://ff.web.sdo.com/web8/index.html#/newstab/newscont/336978","PublishDate":"2022/02/17 15:38:20","OutLink":"","HomeImagePath":"https://fu5.web.sdo.com/10036/202202/16450834782144.jpg"}]}
|
||||
{
|
||||
"Code": "0",
|
||||
"Message": "",
|
||||
"PageCount": 293,
|
||||
"TotalCount": 1465,
|
||||
"RecordCount": 5,
|
||||
"Data": [
|
||||
{
|
||||
"Id": 336868,
|
||||
"Articletype": 3,
|
||||
"ApplicationCode": 92,
|
||||
"CategoryCode": 5310,
|
||||
"SortIndex": 9,
|
||||
"GroupIndex": 0,
|
||||
"TitleClass": "",
|
||||
"Title": "LIVE番外:第68回制作人来信转播 2月19日上演",
|
||||
"Summary": "第68回制作人来信将于2022年2月19日放送,届时FFXIV的制作人兼导演吉田直树将会以「FFXIV的全新挑战 ~面向下一个10年~」为话题为大家介绍今后的更新情报。",
|
||||
"Author": "https://ff.web.sdo.com/web8/index.html#/newstab/newscont/336868",
|
||||
"PublishDate": "2022/02/15 16:02:21",
|
||||
"OutLink": "",
|
||||
"HomeImagePath": "https://fu5.web.sdo.com/10036/202202/16448326143171.jpg"
|
||||
},
|
||||
{
|
||||
"Id": 336969,
|
||||
"Articletype": 3,
|
||||
"ApplicationCode": 92,
|
||||
"CategoryCode": 5310,
|
||||
"SortIndex": 8,
|
||||
"GroupIndex": 0,
|
||||
"TitleClass": "",
|
||||
"Title": "群狼盛宴第20赛季对战数据查询开放",
|
||||
"Summary": "群狼盛宴第20赛季对战数据查询开放。冒险现在可以在专题页面点击右上角的「对战数据查询」来查询第20赛季的总对战场次和胜利场次数据。",
|
||||
"Author": "https://ff.web.sdo.com/web8/index.html#/newstab/newscont/336969",
|
||||
"PublishDate": "2022/02/17 15:09:31",
|
||||
"OutLink": "",
|
||||
"HomeImagePath": "https://fu5.web.sdo.com/10036/202202/16450708307681.jpg"
|
||||
},
|
||||
{
|
||||
"Id": 336870,
|
||||
"Articletype": 3,
|
||||
"ApplicationCode": 92,
|
||||
"CategoryCode": 5310,
|
||||
"SortIndex": 7,
|
||||
"GroupIndex": 0,
|
||||
"TitleClass": "",
|
||||
"Title": "最终幻想XIV 银质坠饰 <友谊永存>预售开启!",
|
||||
"Summary": "最终幻想XIV 银质坠饰 <友谊永存>现已开启预售!",
|
||||
"Author": "https://ff.web.sdo.com/web8/index.html#/newstab/newscont/336870",
|
||||
"PublishDate": "2022/02/18 14:11:09",
|
||||
"OutLink": "",
|
||||
"HomeImagePath": "https://fu5.web.sdo.com/10036/202202/16448345978202.jpg"
|
||||
},
|
||||
{
|
||||
"Id": 336869,
|
||||
"Articletype": 3,
|
||||
"ApplicationCode": 92,
|
||||
"CategoryCode": 5312,
|
||||
"SortIndex": 6,
|
||||
"GroupIndex": 0,
|
||||
"TitleClass": "",
|
||||
"Title": "2月22日「太阳海岸」、「伊修加德」服务器临时维护公告",
|
||||
"Summary": "我们将于2月22日14:00-16:00对豆豆柴区进行临时维护。维护结束后将开启「太阳海岸」、「伊修加德」服务器个人及部队房屋购买功能。",
|
||||
"Author": "https://ff.web.sdo.com/web8/index.html#/newstab/newscont/336869",
|
||||
"PublishDate": "2022/02/15 16:17:13",
|
||||
"OutLink": "",
|
||||
"HomeImagePath": "https://fu5.web.sdo.com/10036/202202/16448330187049.jpg"
|
||||
},
|
||||
{
|
||||
"Id": 336978,
|
||||
"Articletype": 3,
|
||||
"ApplicationCode": 92,
|
||||
"CategoryCode": 5312,
|
||||
"SortIndex": 5,
|
||||
"GroupIndex": 0,
|
||||
"TitleClass": "",
|
||||
"Title": "《最终幻想14》2月17日违规账号处罚公告",
|
||||
"Summary": "为了更好地维护游戏内的游戏秩序,保障各位冒险者良好公正的游戏体验,近期我们对游戏中违反了游戏规定的账号进行了查处,封号名单已更新至违规处理平台中。",
|
||||
"Author": "https://ff.web.sdo.com/web8/index.html#/newstab/newscont/336978",
|
||||
"PublishDate": "2022/02/17 15:38:20",
|
||||
"OutLink": "",
|
||||
"HomeImagePath": "https://fu5.web.sdo.com/10036/202202/16450834782144.jpg"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
60
tests/platforms/static/monster-siren_list_1.json
vendored
60
tests/platforms/static/monster-siren_list_1.json
vendored
@ -1 +1,59 @@
|
||||
{"code":0,"msg":"","data":{"list":[{"cid":"241303","title":"#D.D.D.PHOTO","cate":8,"date":"2021-06-29"},{"cid":"114091","title":"#AUS小屋","cate":8,"date":"2021-06-23"},{"cid":"027726","title":"「音律联觉原声EP」正式上架","cate":1,"date":"2021-06-12"},{"cid":"750459","title":"「ManiFesto:」MV正式公开","cate":1,"date":"2021-06-08"},{"cid":"241304","title":"「Real Me」正式上架","cate":1,"date":"2021-06-01"},{"cid":"578835","title":"#D.D.D.PHOTO","cate":8,"date":"2021-05-24"},{"cid":"489188","title":"#AUS小屋","cate":8,"date":"2021-05-19"},{"cid":"992677","title":"「Immutable」正式上架","cate":1,"date":"2021-05-02"},{"cid":"605962","title":"「Voices」正式上架","cate":1,"date":"2021-05-01"},{"cid":"336213","title":"#D.D.D.PHOTO","cate":8,"date":"2021-04-28"}],"end":false}}
|
||||
{
|
||||
"code": 0,
|
||||
"msg": "",
|
||||
"data": {
|
||||
"list": [
|
||||
{
|
||||
"cid": "241303",
|
||||
"title": "#D.D.D.PHOTO",
|
||||
"cate": 8,
|
||||
"date": "2021-06-29"
|
||||
},
|
||||
{ "cid": "114091", "title": "#AUS小屋", "cate": 8, "date": "2021-06-23" },
|
||||
{
|
||||
"cid": "027726",
|
||||
"title": "「音律联觉原声EP」正式上架",
|
||||
"cate": 1,
|
||||
"date": "2021-06-12"
|
||||
},
|
||||
{
|
||||
"cid": "750459",
|
||||
"title": "「ManiFesto:」MV正式公开",
|
||||
"cate": 1,
|
||||
"date": "2021-06-08"
|
||||
},
|
||||
{
|
||||
"cid": "241304",
|
||||
"title": "「Real Me」正式上架",
|
||||
"cate": 1,
|
||||
"date": "2021-06-01"
|
||||
},
|
||||
{
|
||||
"cid": "578835",
|
||||
"title": "#D.D.D.PHOTO",
|
||||
"cate": 8,
|
||||
"date": "2021-05-24"
|
||||
},
|
||||
{ "cid": "489188", "title": "#AUS小屋", "cate": 8, "date": "2021-05-19" },
|
||||
{
|
||||
"cid": "992677",
|
||||
"title": "「Immutable」正式上架",
|
||||
"cate": 1,
|
||||
"date": "2021-05-02"
|
||||
},
|
||||
{
|
||||
"cid": "605962",
|
||||
"title": "「Voices」正式上架",
|
||||
"cate": 1,
|
||||
"date": "2021-05-01"
|
||||
},
|
||||
{
|
||||
"cid": "336213",
|
||||
"title": "#D.D.D.PHOTO",
|
||||
"cate": 8,
|
||||
"date": "2021-04-28"
|
||||
}
|
||||
],
|
||||
"end": false
|
||||
}
|
||||
}
|
||||
|
56404
tests/platforms/static/ncm_radio_ark.json
vendored
56404
tests/platforms/static/ncm_radio_ark.json
vendored
File diff suppressed because one or more lines are too long
1292
tests/platforms/static/ncm_siren.json
vendored
1292
tests/platforms/static/ncm_siren.json
vendored
File diff suppressed because one or more lines are too long
83
tests/platforms/static/tag_cases.json
vendored
83
tests/platforms/static/tag_cases.json
vendored
@ -1,74 +1,39 @@
|
||||
[
|
||||
{
|
||||
"case": {
|
||||
"post_tags": [
|
||||
"111",
|
||||
"222",
|
||||
"333",
|
||||
"444"
|
||||
],
|
||||
"subscribed_tags": [
|
||||
"222"
|
||||
],
|
||||
"banned_tags": [
|
||||
"555"
|
||||
]
|
||||
"post_tags": ["111", "222", "333", "444"],
|
||||
"subscribed_tags": ["222"],
|
||||
"banned_tags": ["555"]
|
||||
},
|
||||
"result": false
|
||||
},
|
||||
{
|
||||
"case": {
|
||||
"post_tags": [
|
||||
"111",
|
||||
"222",
|
||||
"333",
|
||||
"444"
|
||||
],
|
||||
"post_tags": ["111", "222", "333", "444"],
|
||||
"subscribed_tags": [],
|
||||
"banned_tags": [
|
||||
"555"
|
||||
]
|
||||
"banned_tags": ["555"]
|
||||
},
|
||||
"result": false
|
||||
},
|
||||
{
|
||||
"case": {
|
||||
"post_tags": [
|
||||
"111",
|
||||
"222",
|
||||
"333",
|
||||
"444"
|
||||
],
|
||||
"post_tags": ["111", "222", "333", "444"],
|
||||
"subscribed_tags": [],
|
||||
"banned_tags": [
|
||||
"444"
|
||||
]
|
||||
"banned_tags": ["444"]
|
||||
},
|
||||
"result": true
|
||||
},
|
||||
{
|
||||
"case": {
|
||||
"post_tags": [
|
||||
"111",
|
||||
"222",
|
||||
"333",
|
||||
"444"
|
||||
],
|
||||
"subscribed_tags": [
|
||||
"222"
|
||||
],
|
||||
"post_tags": ["111", "222", "333", "444"],
|
||||
"subscribed_tags": ["222"],
|
||||
"banned_tags": []
|
||||
},
|
||||
"result": false
|
||||
},
|
||||
{
|
||||
"case": {
|
||||
"post_tags": [
|
||||
"111",
|
||||
"222",
|
||||
"333",
|
||||
"444"
|
||||
],
|
||||
"post_tags": ["111", "222", "333", "444"],
|
||||
"subscribed_tags": [],
|
||||
"banned_tags": []
|
||||
},
|
||||
@ -76,12 +41,7 @@
|
||||
},
|
||||
{
|
||||
"case": {
|
||||
"post_tags": [
|
||||
"111",
|
||||
"222",
|
||||
"333",
|
||||
"444"
|
||||
],
|
||||
"post_tags": ["111", "222", "333", "444"],
|
||||
"subscribed_tags": ["111", "555", "666"],
|
||||
"banned_tags": []
|
||||
},
|
||||
@ -89,12 +49,7 @@
|
||||
},
|
||||
{
|
||||
"case": {
|
||||
"post_tags": [
|
||||
"111",
|
||||
"222",
|
||||
"333",
|
||||
"444"
|
||||
],
|
||||
"post_tags": ["111", "222", "333", "444"],
|
||||
"subscribed_tags": ["111", "555"],
|
||||
"banned_tags": ["333"]
|
||||
},
|
||||
@ -102,12 +57,7 @@
|
||||
},
|
||||
{
|
||||
"case": {
|
||||
"post_tags": [
|
||||
"111",
|
||||
"222",
|
||||
"333",
|
||||
"444"
|
||||
],
|
||||
"post_tags": ["111", "222", "333", "444"],
|
||||
"subscribed_tags": ["111", "333"],
|
||||
"banned_tags": ["111"]
|
||||
},
|
||||
@ -115,12 +65,7 @@
|
||||
},
|
||||
{
|
||||
"case": {
|
||||
"post_tags": [
|
||||
"111",
|
||||
"222",
|
||||
"333",
|
||||
"444"
|
||||
],
|
||||
"post_tags": ["111", "222", "333", "444"],
|
||||
"subscribed_tags": ["222"],
|
||||
"banned_tags": ["555", "333"]
|
||||
},
|
||||
|
37
tests/platforms/static/terra-hist-0.json
vendored
37
tests/platforms/static/terra-hist-0.json
vendored
@ -1 +1,36 @@
|
||||
{"code":0,"msg":"","data":[{"coverUrl":"https://web.hycdn.cn/comic/pic/20220507/c4da4fb95587101f1867a30fe85cb557.png","comicCid":"6253","title":"123罗德岛!?","subtitle":"你可能不知道的罗德岛小剧场!","episodeCid":"5771","episodeType":1,"episodeShortTitle":"「流明」篇","updateTime":1652025600},{"coverUrl":"https://web.hycdn.cn/comic/pic/20220505/5c296539f5dc808603f20dda86879c9c.png","comicCid":"0696","title":"A1行动预备组","subtitle":"","episodeCid":"2897","episodeType":1,"episodeShortTitle":"01","updateTime":1651852800},{"coverUrl":"https://web.hycdn.cn/comic/pic/20220428/f4dc1e91420d18eccb80d60bba322d42.png","comicCid":"6253","title":"123罗德岛!?","subtitle":"你可能不知道的罗德岛小剧场!","episodeCid":"6346","episodeType":1,"episodeShortTitle":"「艾丽妮」篇","updateTime":1651507200}]}
|
||||
{
|
||||
"code": 0,
|
||||
"msg": "",
|
||||
"data": [
|
||||
{
|
||||
"coverUrl": "https://web.hycdn.cn/comic/pic/20220507/c4da4fb95587101f1867a30fe85cb557.png",
|
||||
"comicCid": "6253",
|
||||
"title": "123罗德岛!?",
|
||||
"subtitle": "你可能不知道的罗德岛小剧场!",
|
||||
"episodeCid": "5771",
|
||||
"episodeType": 1,
|
||||
"episodeShortTitle": "「流明」篇",
|
||||
"updateTime": 1652025600
|
||||
},
|
||||
{
|
||||
"coverUrl": "https://web.hycdn.cn/comic/pic/20220505/5c296539f5dc808603f20dda86879c9c.png",
|
||||
"comicCid": "0696",
|
||||
"title": "A1行动预备组",
|
||||
"subtitle": "",
|
||||
"episodeCid": "2897",
|
||||
"episodeType": 1,
|
||||
"episodeShortTitle": "01",
|
||||
"updateTime": 1651852800
|
||||
},
|
||||
{
|
||||
"coverUrl": "https://web.hycdn.cn/comic/pic/20220428/f4dc1e91420d18eccb80d60bba322d42.png",
|
||||
"comicCid": "6253",
|
||||
"title": "123罗德岛!?",
|
||||
"subtitle": "你可能不知道的罗德岛小剧场!",
|
||||
"episodeCid": "6346",
|
||||
"episodeType": 1,
|
||||
"episodeShortTitle": "「艾丽妮」篇",
|
||||
"updateTime": 1651507200
|
||||
}
|
||||
]
|
||||
}
|
||||
|
47
tests/platforms/static/terra-hist-1.json
vendored
47
tests/platforms/static/terra-hist-1.json
vendored
@ -1 +1,46 @@
|
||||
{"code":0,"msg":"","data":[{"coverUrl":"https://web.hycdn.cn/comic/pic/20220507/ab8a2ff408ec7d587775aed70b178ec0.png","comicCid":"6253","title":"123罗德岛!?","subtitle":"你可能不知道的罗德岛小剧场!","episodeCid":"4938","episodeType":1,"episodeShortTitle":"「掠风」篇","updateTime":1652112000},{"coverUrl":"https://web.hycdn.cn/comic/pic/20220507/c4da4fb95587101f1867a30fe85cb557.png","comicCid":"6253","title":"123罗德岛!?","subtitle":"你可能不知道的罗德岛小剧场!","episodeCid":"5771","episodeType":1,"episodeShortTitle":"「流明」篇","updateTime":1652025600},{"coverUrl":"https://web.hycdn.cn/comic/pic/20220505/5c296539f5dc808603f20dda86879c9c.png","comicCid":"0696","title":"A1行动预备组","subtitle":"","episodeCid":"2897","episodeType":1,"episodeShortTitle":"01","updateTime":1651852800},{"coverUrl":"https://web.hycdn.cn/comic/pic/20220428/f4dc1e91420d18eccb80d60bba322d42.png","comicCid":"6253","title":"123罗德岛!?","subtitle":"你可能不知道的罗德岛小剧场!","episodeCid":"6346","episodeType":1,"episodeShortTitle":"「艾丽妮」篇","updateTime":1651507200}]}
|
||||
{
|
||||
"code": 0,
|
||||
"msg": "",
|
||||
"data": [
|
||||
{
|
||||
"coverUrl": "https://web.hycdn.cn/comic/pic/20220507/ab8a2ff408ec7d587775aed70b178ec0.png",
|
||||
"comicCid": "6253",
|
||||
"title": "123罗德岛!?",
|
||||
"subtitle": "你可能不知道的罗德岛小剧场!",
|
||||
"episodeCid": "4938",
|
||||
"episodeType": 1,
|
||||
"episodeShortTitle": "「掠风」篇",
|
||||
"updateTime": 1652112000
|
||||
},
|
||||
{
|
||||
"coverUrl": "https://web.hycdn.cn/comic/pic/20220507/c4da4fb95587101f1867a30fe85cb557.png",
|
||||
"comicCid": "6253",
|
||||
"title": "123罗德岛!?",
|
||||
"subtitle": "你可能不知道的罗德岛小剧场!",
|
||||
"episodeCid": "5771",
|
||||
"episodeType": 1,
|
||||
"episodeShortTitle": "「流明」篇",
|
||||
"updateTime": 1652025600
|
||||
},
|
||||
{
|
||||
"coverUrl": "https://web.hycdn.cn/comic/pic/20220505/5c296539f5dc808603f20dda86879c9c.png",
|
||||
"comicCid": "0696",
|
||||
"title": "A1行动预备组",
|
||||
"subtitle": "",
|
||||
"episodeCid": "2897",
|
||||
"episodeType": 1,
|
||||
"episodeShortTitle": "01",
|
||||
"updateTime": 1651852800
|
||||
},
|
||||
{
|
||||
"coverUrl": "https://web.hycdn.cn/comic/pic/20220428/f4dc1e91420d18eccb80d60bba322d42.png",
|
||||
"comicCid": "6253",
|
||||
"title": "123罗德岛!?",
|
||||
"subtitle": "你可能不知道的罗德岛小剧场!",
|
||||
"episodeCid": "6346",
|
||||
"episodeType": 1,
|
||||
"episodeShortTitle": "「艾丽妮」篇",
|
||||
"updateTime": 1651507200
|
||||
}
|
||||
]
|
||||
}
|
||||
|
24
tests/platforms/static/weibo_ak_list_0.json
vendored
24
tests/platforms/static/weibo_ak_list_0.json
vendored
@ -157,9 +157,7 @@
|
||||
"textLength": 671,
|
||||
"source": "微博 weibo.com",
|
||||
"favorited": false,
|
||||
"pic_ids": [
|
||||
"006QZngZgy1grl2q3n98jj30rs2084qp"
|
||||
],
|
||||
"pic_ids": ["006QZngZgy1grl2q3n98jj30rs2084qp"],
|
||||
"pic_types": "",
|
||||
"thumbnail_pic": "https://wx1.sinaimg.cn/thumbnail/006QZngZgy1grl2q3n98jj30rs2084qp.jpg",
|
||||
"bmiddle_pic": "http://wx1.sinaimg.cn/bmiddle/006QZngZgy1grl2q3n98jj30rs2084qp.jpg",
|
||||
@ -471,9 +469,7 @@
|
||||
"textLength": 55,
|
||||
"source": "微博 weibo.com",
|
||||
"favorited": false,
|
||||
"pic_ids": [
|
||||
"006QZngZgy1grht0d1dbij31hc0u0kjl"
|
||||
],
|
||||
"pic_ids": ["006QZngZgy1grht0d1dbij31hc0u0kjl"],
|
||||
"pic_types": "",
|
||||
"thumbnail_pic": "https://wx1.sinaimg.cn/thumbnail/006QZngZgy1grht0d1dbij31hc0u0kjl.jpg",
|
||||
"bmiddle_pic": "http://wx1.sinaimg.cn/bmiddle/006QZngZgy1grht0d1dbij31hc0u0kjl.jpg",
|
||||
@ -589,9 +585,7 @@
|
||||
"textLength": 327,
|
||||
"source": "微博 weibo.com",
|
||||
"favorited": false,
|
||||
"pic_ids": [
|
||||
"006QZngZgy1grfa218wmdj30u00u0e81"
|
||||
],
|
||||
"pic_ids": ["006QZngZgy1grfa218wmdj30u00u0e81"],
|
||||
"pic_types": "",
|
||||
"thumbnail_pic": "https://wx2.sinaimg.cn/thumbnail/006QZngZgy1grfa218wmdj30u00u0e81.jpg",
|
||||
"bmiddle_pic": "http://wx2.sinaimg.cn/bmiddle/006QZngZgy1grfa218wmdj30u00u0e81.jpg",
|
||||
@ -707,9 +701,7 @@
|
||||
"textLength": 203,
|
||||
"source": "微博 weibo.com",
|
||||
"favorited": false,
|
||||
"pic_ids": [
|
||||
"006QZngZgy1grfa0r0o4mj319u0p07wh"
|
||||
],
|
||||
"pic_ids": ["006QZngZgy1grfa0r0o4mj319u0p07wh"],
|
||||
"pic_types": "",
|
||||
"thumbnail_pic": "https://wx1.sinaimg.cn/thumbnail/006QZngZgy1grfa0r0o4mj319u0p07wh.jpg",
|
||||
"bmiddle_pic": "http://wx1.sinaimg.cn/bmiddle/006QZngZgy1grfa0r0o4mj319u0p07wh.jpg",
|
||||
@ -1232,9 +1224,7 @@
|
||||
"textLength": 547,
|
||||
"source": "微博 weibo.com",
|
||||
"favorited": false,
|
||||
"pic_ids": [
|
||||
"006QZngZgy1grd08yco5cj31jk0rse5p"
|
||||
],
|
||||
"pic_ids": ["006QZngZgy1grd08yco5cj31jk0rse5p"],
|
||||
"pic_types": "",
|
||||
"thumbnail_pic": "https://wx2.sinaimg.cn/thumbnail/006QZngZgy1grd08yco5cj31jk0rse5p.jpg",
|
||||
"bmiddle_pic": "http://wx2.sinaimg.cn/bmiddle/006QZngZgy1grd08yco5cj31jk0rse5p.jpg",
|
||||
@ -1351,9 +1341,7 @@
|
||||
"textLength": 321,
|
||||
"source": "微博 weibo.com",
|
||||
"favorited": false,
|
||||
"pic_ids": [
|
||||
"006QZngZgy1grc01ug565j30xp0go4qp"
|
||||
],
|
||||
"pic_ids": ["006QZngZgy1grc01ug565j30xp0go4qp"],
|
||||
"pic_types": "",
|
||||
"thumbnail_pic": "https://wx3.sinaimg.cn/thumbnail/006QZngZgy1grc01ug565j30xp0go4qp.jpg",
|
||||
"bmiddle_pic": "http://wx3.sinaimg.cn/bmiddle/006QZngZgy1grc01ug565j30xp0go4qp.jpg",
|
||||
|
28
tests/platforms/static/weibo_ak_list_1.json
vendored
28
tests/platforms/static/weibo_ak_list_1.json
vendored
@ -157,9 +157,7 @@
|
||||
"textLength": 52,
|
||||
"source": "微博 weibo.com",
|
||||
"favorited": false,
|
||||
"pic_ids": [
|
||||
"006QZngZgy1grlb68fzfvj31hc0u0b29"
|
||||
],
|
||||
"pic_ids": ["006QZngZgy1grlb68fzfvj31hc0u0b29"],
|
||||
"pic_types": "",
|
||||
"thumbnail_pic": "https://wx1.sinaimg.cn/thumbnail/006QZngZgy1grlb68fzfvj31hc0u0b29.jpg",
|
||||
"bmiddle_pic": "http://wx1.sinaimg.cn/bmiddle/006QZngZgy1grlb68fzfvj31hc0u0b29.jpg",
|
||||
@ -283,9 +281,7 @@
|
||||
"textLength": 671,
|
||||
"source": "微博 weibo.com",
|
||||
"favorited": false,
|
||||
"pic_ids": [
|
||||
"006QZngZgy1grl2q3n98jj30rs2084qp"
|
||||
],
|
||||
"pic_ids": ["006QZngZgy1grl2q3n98jj30rs2084qp"],
|
||||
"pic_types": "",
|
||||
"thumbnail_pic": "https://wx1.sinaimg.cn/thumbnail/006QZngZgy1grl2q3n98jj30rs2084qp.jpg",
|
||||
"bmiddle_pic": "http://wx1.sinaimg.cn/bmiddle/006QZngZgy1grl2q3n98jj30rs2084qp.jpg",
|
||||
@ -597,9 +593,7 @@
|
||||
"textLength": 55,
|
||||
"source": "微博 weibo.com",
|
||||
"favorited": false,
|
||||
"pic_ids": [
|
||||
"006QZngZgy1grht0d1dbij31hc0u0kjl"
|
||||
],
|
||||
"pic_ids": ["006QZngZgy1grht0d1dbij31hc0u0kjl"],
|
||||
"pic_types": "",
|
||||
"thumbnail_pic": "https://wx1.sinaimg.cn/thumbnail/006QZngZgy1grht0d1dbij31hc0u0kjl.jpg",
|
||||
"bmiddle_pic": "http://wx1.sinaimg.cn/bmiddle/006QZngZgy1grht0d1dbij31hc0u0kjl.jpg",
|
||||
@ -715,9 +709,7 @@
|
||||
"textLength": 327,
|
||||
"source": "微博 weibo.com",
|
||||
"favorited": false,
|
||||
"pic_ids": [
|
||||
"006QZngZgy1grfa218wmdj30u00u0e81"
|
||||
],
|
||||
"pic_ids": ["006QZngZgy1grfa218wmdj30u00u0e81"],
|
||||
"pic_types": "",
|
||||
"thumbnail_pic": "https://wx2.sinaimg.cn/thumbnail/006QZngZgy1grfa218wmdj30u00u0e81.jpg",
|
||||
"bmiddle_pic": "http://wx2.sinaimg.cn/bmiddle/006QZngZgy1grfa218wmdj30u00u0e81.jpg",
|
||||
@ -833,9 +825,7 @@
|
||||
"textLength": 203,
|
||||
"source": "微博 weibo.com",
|
||||
"favorited": false,
|
||||
"pic_ids": [
|
||||
"006QZngZgy1grfa0r0o4mj319u0p07wh"
|
||||
],
|
||||
"pic_ids": ["006QZngZgy1grfa0r0o4mj319u0p07wh"],
|
||||
"pic_types": "",
|
||||
"thumbnail_pic": "https://wx1.sinaimg.cn/thumbnail/006QZngZgy1grfa0r0o4mj319u0p07wh.jpg",
|
||||
"bmiddle_pic": "http://wx1.sinaimg.cn/bmiddle/006QZngZgy1grfa0r0o4mj319u0p07wh.jpg",
|
||||
@ -1358,9 +1348,7 @@
|
||||
"textLength": 547,
|
||||
"source": "微博 weibo.com",
|
||||
"favorited": false,
|
||||
"pic_ids": [
|
||||
"006QZngZgy1grd08yco5cj31jk0rse5p"
|
||||
],
|
||||
"pic_ids": ["006QZngZgy1grd08yco5cj31jk0rse5p"],
|
||||
"pic_types": "",
|
||||
"thumbnail_pic": "https://wx2.sinaimg.cn/thumbnail/006QZngZgy1grd08yco5cj31jk0rse5p.jpg",
|
||||
"bmiddle_pic": "http://wx2.sinaimg.cn/bmiddle/006QZngZgy1grd08yco5cj31jk0rse5p.jpg",
|
||||
@ -1477,9 +1465,7 @@
|
||||
"textLength": 321,
|
||||
"source": "微博 weibo.com",
|
||||
"favorited": false,
|
||||
"pic_ids": [
|
||||
"006QZngZgy1grc01ug565j30xp0go4qp"
|
||||
],
|
||||
"pic_ids": ["006QZngZgy1grc01ug565j30xp0go4qp"],
|
||||
"pic_types": "",
|
||||
"thumbnail_pic": "https://wx3.sinaimg.cn/thumbnail/006QZngZgy1grc01ug565j30xp0go4qp.jpg",
|
||||
"bmiddle_pic": "http://wx3.sinaimg.cn/bmiddle/006QZngZgy1grc01ug565j30xp0go4qp.jpg",
|
||||
|
127
tests/platforms/static/weibo_ak_profile.json
vendored
127
tests/platforms/static/weibo_ak_profile.json
vendored
@ -1 +1,126 @@
|
||||
{"ok":1,"data":{"isVideoCoverStyle":1,"isStarStyle":0,"userInfo":{"id":6279793937,"screen_name":"\u660e\u65e5\u65b9\u821fArknights","profile_image_url":"https:\/\/tvax4.sinaimg.cn\/crop.0.0.756.756.180\/006QZngZly8gdj05mufr9j30l00l0dq4.jpg?KID=imgbed,tva&Expires=1645010805&ssig=POD2VKV4LB","profile_url":"https:\/\/m.weibo.cn\/u\/6279793937?uid=6279793937&luicode=10000011&lfid=1005056279793937","statuses_count":1553,"verified":true,"verified_type":2,"verified_type_ext":50,"verified_reason":"\u4e0a\u6d77\u9e70\u89d2\u7f51\u7edc\u79d1\u6280\u6709\u9650\u516c\u53f8","close_blue_v":false,"description":"\u300a\u660e\u65e5\u65b9\u821f\u300b\u5b98\u65b9\u5fae\u535a\uff0c\u6b22\u8fce\u54a8\u8be2\u5ba2\u670dQQ\u670d\u52a1\u53f7\uff1a800830064","gender":"f","mbtype":12,"urank":4,"mbrank":7,"follow_me":false,"following":false,"follow_count":34,"followers_count":"145.5\u4e07","followers_count_str":"145.5\u4e07","cover_image_phone":"https:\/\/wx4.sinaimg.cn\/crop.0.0.640.640.640\/006QZngZly1gq8sa16csgj30u00u0akt.jpg","avatar_hd":"https:\/\/wx4.sinaimg.cn\/orj480\/006QZngZly8gdj05mufr9j30l00l0dq4.jpg","like":false,"like_me":false,"toolbar_menus":[{"type":"link","name":"\u804a\u5929","pic":"http:\/\/h5.sinaimg.cn\/upload\/2015\/06\/12\/2\/toolbar_icon_discuss_default.png","params":{"scheme":"sinaweibo:\/\/messagelist?uid=6279793937&nick=\u660e\u65e5\u65b9\u821fArknights"},"scheme":"https:\/\/passport.weibo.cn\/signin\/welcome?entry=mweibo&r=https%3A%2F%2Fm.weibo.cn%2Fapi%2Fcontainer%2FgetIndex%3Fcontainerid%3D1005056279793937"},{"type":"profile_follow","name":"\u5173\u6ce8","pic":"","params":{"uid":6279793937,"extparams":{"followcardid":"0001980001_6279793937_b2f217e4"}},"userInfo":{"id":6279793937,"idstr":"6279793937","screen_name":"\u660e\u65e5\u65b9\u821fArknights","profile_image_url":"https:\/\/tvax4.sinaimg.cn\/crop.0.0.756.756.50\/006QZngZly8gdj05mufr9j30l00l0dq4.jpg?KID=imgbed,tva&Expires=1645010805&ssig=pKJtZwv%2FHm","following":false,"verified":true,"verified_type":2,"remark":"","avatar_large":"https:\/\/tvax4.sinaimg.cn\/crop.0.0.756.756.180\/006QZngZly8gdj05mufr9j30l00l0dq4.jpg?KID=imgbed,tva&Expires=1645010805&ssig=POD2VKV4LB","avatar_hd":"https:\/\/tvax4.sinaimg.cn\/crop.0.0.756.756.1024\/006QZngZly8gdj05mufr9j30l00l0dq4.jpg?KID=imgbed,tva&Expires=1645010805&ssig=RBGOJz6PB6","verified_type_ext":50,"follow_me":false,"mbtype":12,"mbrank":6,"level":2,"type":1,"story_read_state":-1,"allow_msg":1,"friendships_relation":0,"close_friends_type":0,"special_follow":false}}]},"fans_scheme":"https:\/\/m.weibo.cn\/c\/attention\/visit?showmenu=0&sign=6279793937&source=MQ%3D%3D&role=NA%3D%3D&luicode=10000011&lfid=1005056279793937","follow_scheme":"https:\/\/m.weibo.cn\/c\/attention\/visit?showmenu=0&sign=6279793937&source=MA%3D%3D&role=NA%3D%3D&luicode=10000011&lfid=1005056279793937","tabsInfo":{"selectedTab":1,"tabs":[{"id":1,"tabKey":"profile","must_show":1,"hidden":0,"title":"\u7cbe\u9009","tab_type":"profile","containerid":"2302836279793937"},{"id":2,"tabKey":"weibo","must_show":1,"hidden":0,"title":"\u5fae\u535a","tab_type":"weibo","containerid":"1076036279793937","apipath":"\/profile\/statuses","tab_icon":"https:\/\/h5.sinaimg.cn\/upload\/1059\/799\/2021\/04\/01\/weibotab.png","tab_icon_dark":"https:\/\/h5.sinaimg.cn\/upload\/1059\/799\/2021\/04\/07\/weibotab_dark.png","url":"\/index\/my"},{"id":4,"tabKey":"original_video","must_show":0,"hidden":0,"title":"\u89c6\u9891","tab_type":"video","containerid":"2315676279793937"},{"id":10,"tabKey":"album","must_show":0,"hidden":0,"title":"\u76f8\u518c","tab_type":"album","containerid":"1078036279793937"}]},"profile_ext":"touid:6279793937","scheme":"sinaweibo:\/\/userinfo?uid=6279793937&_T_WM=38226655008&v_p=42&uid=6279793937&luicode=10000011&lfid=1005056279793937","showAppTips":0}}
|
||||
{
|
||||
"ok": 1,
|
||||
"data": {
|
||||
"isVideoCoverStyle": 1,
|
||||
"isStarStyle": 0,
|
||||
"userInfo": {
|
||||
"id": 6279793937,
|
||||
"screen_name": "\u660e\u65e5\u65b9\u821fArknights",
|
||||
"profile_image_url": "https://tvax4.sinaimg.cn/crop.0.0.756.756.180/006QZngZly8gdj05mufr9j30l00l0dq4.jpg?KID=imgbed,tva&Expires=1645010805&ssig=POD2VKV4LB",
|
||||
"profile_url": "https://m.weibo.cn/u/6279793937?uid=6279793937&luicode=10000011&lfid=1005056279793937",
|
||||
"statuses_count": 1553,
|
||||
"verified": true,
|
||||
"verified_type": 2,
|
||||
"verified_type_ext": 50,
|
||||
"verified_reason": "\u4e0a\u6d77\u9e70\u89d2\u7f51\u7edc\u79d1\u6280\u6709\u9650\u516c\u53f8",
|
||||
"close_blue_v": false,
|
||||
"description": "\u300a\u660e\u65e5\u65b9\u821f\u300b\u5b98\u65b9\u5fae\u535a\uff0c\u6b22\u8fce\u54a8\u8be2\u5ba2\u670dQQ\u670d\u52a1\u53f7\uff1a800830064",
|
||||
"gender": "f",
|
||||
"mbtype": 12,
|
||||
"urank": 4,
|
||||
"mbrank": 7,
|
||||
"follow_me": false,
|
||||
"following": false,
|
||||
"follow_count": 34,
|
||||
"followers_count": "145.5\u4e07",
|
||||
"followers_count_str": "145.5\u4e07",
|
||||
"cover_image_phone": "https://wx4.sinaimg.cn/crop.0.0.640.640.640/006QZngZly1gq8sa16csgj30u00u0akt.jpg",
|
||||
"avatar_hd": "https://wx4.sinaimg.cn/orj480/006QZngZly8gdj05mufr9j30l00l0dq4.jpg",
|
||||
"like": false,
|
||||
"like_me": false,
|
||||
"toolbar_menus": [
|
||||
{
|
||||
"type": "link",
|
||||
"name": "\u804a\u5929",
|
||||
"pic": "http://h5.sinaimg.cn/upload/2015/06/12/2/toolbar_icon_discuss_default.png",
|
||||
"params": {
|
||||
"scheme": "sinaweibo://messagelist?uid=6279793937&nick=\u660e\u65e5\u65b9\u821fArknights"
|
||||
},
|
||||
"scheme": "https://passport.weibo.cn/signin/welcome?entry=mweibo&r=https%3A%2F%2Fm.weibo.cn%2Fapi%2Fcontainer%2FgetIndex%3Fcontainerid%3D1005056279793937"
|
||||
},
|
||||
{
|
||||
"type": "profile_follow",
|
||||
"name": "\u5173\u6ce8",
|
||||
"pic": "",
|
||||
"params": {
|
||||
"uid": 6279793937,
|
||||
"extparams": { "followcardid": "0001980001_6279793937_b2f217e4" }
|
||||
},
|
||||
"userInfo": {
|
||||
"id": 6279793937,
|
||||
"idstr": "6279793937",
|
||||
"screen_name": "\u660e\u65e5\u65b9\u821fArknights",
|
||||
"profile_image_url": "https://tvax4.sinaimg.cn/crop.0.0.756.756.50/006QZngZly8gdj05mufr9j30l00l0dq4.jpg?KID=imgbed,tva&Expires=1645010805&ssig=pKJtZwv%2FHm",
|
||||
"following": false,
|
||||
"verified": true,
|
||||
"verified_type": 2,
|
||||
"remark": "",
|
||||
"avatar_large": "https://tvax4.sinaimg.cn/crop.0.0.756.756.180/006QZngZly8gdj05mufr9j30l00l0dq4.jpg?KID=imgbed,tva&Expires=1645010805&ssig=POD2VKV4LB",
|
||||
"avatar_hd": "https://tvax4.sinaimg.cn/crop.0.0.756.756.1024/006QZngZly8gdj05mufr9j30l00l0dq4.jpg?KID=imgbed,tva&Expires=1645010805&ssig=RBGOJz6PB6",
|
||||
"verified_type_ext": 50,
|
||||
"follow_me": false,
|
||||
"mbtype": 12,
|
||||
"mbrank": 6,
|
||||
"level": 2,
|
||||
"type": 1,
|
||||
"story_read_state": -1,
|
||||
"allow_msg": 1,
|
||||
"friendships_relation": 0,
|
||||
"close_friends_type": 0,
|
||||
"special_follow": false
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"fans_scheme": "https://m.weibo.cn/c/attention/visit?showmenu=0&sign=6279793937&source=MQ%3D%3D&role=NA%3D%3D&luicode=10000011&lfid=1005056279793937",
|
||||
"follow_scheme": "https://m.weibo.cn/c/attention/visit?showmenu=0&sign=6279793937&source=MA%3D%3D&role=NA%3D%3D&luicode=10000011&lfid=1005056279793937",
|
||||
"tabsInfo": {
|
||||
"selectedTab": 1,
|
||||
"tabs": [
|
||||
{
|
||||
"id": 1,
|
||||
"tabKey": "profile",
|
||||
"must_show": 1,
|
||||
"hidden": 0,
|
||||
"title": "\u7cbe\u9009",
|
||||
"tab_type": "profile",
|
||||
"containerid": "2302836279793937"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"tabKey": "weibo",
|
||||
"must_show": 1,
|
||||
"hidden": 0,
|
||||
"title": "\u5fae\u535a",
|
||||
"tab_type": "weibo",
|
||||
"containerid": "1076036279793937",
|
||||
"apipath": "/profile/statuses",
|
||||
"tab_icon": "https://h5.sinaimg.cn/upload/1059/799/2021/04/01/weibotab.png",
|
||||
"tab_icon_dark": "https://h5.sinaimg.cn/upload/1059/799/2021/04/07/weibotab_dark.png",
|
||||
"url": "/index/my"
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"tabKey": "original_video",
|
||||
"must_show": 0,
|
||||
"hidden": 0,
|
||||
"title": "\u89c6\u9891",
|
||||
"tab_type": "video",
|
||||
"containerid": "2315676279793937"
|
||||
},
|
||||
{
|
||||
"id": 10,
|
||||
"tabKey": "album",
|
||||
"must_show": 0,
|
||||
"hidden": 0,
|
||||
"title": "\u76f8\u518c",
|
||||
"tab_type": "album",
|
||||
"containerid": "1078036279793937"
|
||||
}
|
||||
]
|
||||
},
|
||||
"profile_ext": "touid:6279793937",
|
||||
"scheme": "sinaweibo://userinfo?uid=6279793937&_T_WM=38226655008&v_p=42&uid=6279793937&luicode=10000011&lfid=1005056279793937",
|
||||
"showAppTips": 0
|
||||
}
|
||||
}
|
||||
|
@ -1 +1,5 @@
|
||||
{"ok":0,"msg":"\u8fd9\u91cc\u8fd8\u6ca1\u6709\u5185\u5bb9","data":{"cards":[]}}
|
||||
{
|
||||
"ok": 0,
|
||||
"msg": "\u8fd9\u91cc\u8fd8\u6ca1\u6709\u5185\u5bb9",
|
||||
"data": { "cards": [] }
|
||||
}
|
||||
|
1743
tests/platforms/static/weibo_ys_list_0.json
vendored
1743
tests/platforms/static/weibo_ys_list_0.json
vendored
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
||||
import pytest
|
||||
from httpx import AsyncClient
|
||||
from nonebug.app import App
|
||||
from httpx import AsyncClient
|
||||
|
||||
from .utils import get_json
|
||||
|
||||
@ -13,8 +13,8 @@ def test_cases():
|
||||
# 测试正反tag的判断情况
|
||||
@pytest.mark.asyncio
|
||||
async def test_filter_user_custom_tag(app: App, test_cases):
|
||||
from nonebot_bison.platform import platform_manager
|
||||
from nonebot_bison.utils import ProcessContext
|
||||
from nonebot_bison.platform import platform_manager
|
||||
|
||||
bilibili = platform_manager["bilibili"](ProcessContext(), AsyncClient())
|
||||
for case in test_cases:
|
||||
@ -25,8 +25,8 @@ async def test_filter_user_custom_tag(app: App, test_cases):
|
||||
# 测试正反tag的分离情况
|
||||
@pytest.mark.asyncio
|
||||
async def test_tag_separator(app: App):
|
||||
from nonebot_bison.platform import platform_manager
|
||||
from nonebot_bison.utils import ProcessContext
|
||||
from nonebot_bison.platform import platform_manager
|
||||
|
||||
bilibili = platform_manager["bilibili"](ProcessContext(), AsyncClient())
|
||||
tags = ["~111", "222", "333", "~444", "555"]
|
||||
|
@ -1,7 +1,7 @@
|
||||
import pytest
|
||||
from nonebug import App
|
||||
|
||||
from ..utils import fake_group_message_event, fake_private_message_event, fake_superuser
|
||||
from ..utils import fake_superuser, fake_group_message_event, fake_private_message_event
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@ -22,9 +22,7 @@ async def test_query_with_superuser_private(app: App):
|
||||
ctx.receive_event(bot, event)
|
||||
ctx.should_pass_rule()
|
||||
ctx.should_pass_permission()
|
||||
ctx.should_call_api(
|
||||
"get_group_list", {}, [{"group_id": 101, "group_name": "test group"}]
|
||||
)
|
||||
ctx.should_call_api("get_group_list", {}, [{"group_id": 101, "group_name": "test group"}])
|
||||
ctx.should_call_send(
|
||||
event,
|
||||
"请选择需要管理的群:\n1. 101 - test group\n请输入左侧序号\n中止操作请输入'取消'",
|
||||
@ -85,9 +83,7 @@ async def test_query_with_abort_on_idx(app: App):
|
||||
ctx.receive_event(bot, event)
|
||||
ctx.should_pass_rule()
|
||||
ctx.should_pass_permission()
|
||||
ctx.should_call_api(
|
||||
"get_group_list", {}, [{"group_id": 101, "group_name": "test group"}]
|
||||
)
|
||||
ctx.should_call_api("get_group_list", {}, [{"group_id": 101, "group_name": "test group"}])
|
||||
ctx.should_call_send(
|
||||
event,
|
||||
"请选择需要管理的群:\n1. 101 - test group\n请输入左侧序号\n中止操作请输入'取消'",
|
||||
@ -121,9 +117,7 @@ async def test_query_with_abort_on_command(app: App):
|
||||
ctx.receive_event(bot, event)
|
||||
ctx.should_pass_rule()
|
||||
ctx.should_pass_permission()
|
||||
ctx.should_call_api(
|
||||
"get_group_list", {}, [{"group_id": 101, "group_name": "test group"}]
|
||||
)
|
||||
ctx.should_call_api("get_group_list", {}, [{"group_id": 101, "group_name": "test group"}])
|
||||
ctx.should_call_send(
|
||||
event,
|
||||
"请选择需要管理的群:\n1. 101 - test group\n请输入左侧序号\n中止操作请输入'取消'",
|
||||
|
@ -27,10 +27,7 @@
|
||||
"subs": [
|
||||
{
|
||||
"categories": [],
|
||||
"tags": [
|
||||
"kaltsit",
|
||||
"amiya"
|
||||
],
|
||||
"tags": ["kaltsit", "amiya"],
|
||||
"target": {
|
||||
"target_name": "weibo_name",
|
||||
"target": "weibo_id",
|
||||
@ -39,10 +36,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"categories": [
|
||||
1,
|
||||
2
|
||||
],
|
||||
"categories": [1, 2],
|
||||
"tags": [],
|
||||
"target": {
|
||||
"target_name": "bilibili_name",
|
||||
|
@ -26,10 +26,7 @@
|
||||
},
|
||||
"subs": [
|
||||
{
|
||||
"tags": [
|
||||
"kaltsit",
|
||||
"amiya"
|
||||
],
|
||||
"tags": ["kaltsit", "amiya"],
|
||||
"target": {
|
||||
"target_name": "weibo_name",
|
||||
"target": "weibo_id",
|
||||
@ -38,10 +35,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"categories": [
|
||||
1,
|
||||
2
|
||||
],
|
||||
"categories": [1, 2],
|
||||
"tags": [],
|
||||
"target": [
|
||||
{
|
||||
|
@ -27,10 +27,7 @@
|
||||
"subs": [
|
||||
{
|
||||
"categories": [],
|
||||
"tags": [
|
||||
"kaltsit",
|
||||
"amiya"
|
||||
],
|
||||
"tags": ["kaltsit", "amiya"],
|
||||
"target": {
|
||||
"target_name": "weibo_name",
|
||||
"target": "weibo_id",
|
||||
@ -39,10 +36,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"categories": [
|
||||
1,
|
||||
2
|
||||
],
|
||||
"categories": [1, 2],
|
||||
"tags": [],
|
||||
"target": {
|
||||
"target_name": "bilibili_name",
|
||||
@ -70,13 +64,8 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"categories": [
|
||||
2,
|
||||
6
|
||||
],
|
||||
"tags": [
|
||||
"poca"
|
||||
],
|
||||
"categories": [2, 6],
|
||||
"tags": ["poca"],
|
||||
"target": {
|
||||
"target_name": "weibo_name2",
|
||||
"target": "weibo_id2",
|
||||
|
@ -27,10 +27,7 @@
|
||||
"subs": [
|
||||
{
|
||||
"categories": [],
|
||||
"tags": [
|
||||
"kaltsit",
|
||||
"amiya"
|
||||
],
|
||||
"tags": ["kaltsit", "amiya"],
|
||||
"target": {
|
||||
"target_name": "weibo_name",
|
||||
"target": "weibo_id",
|
||||
@ -39,10 +36,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"categories": [
|
||||
1,
|
||||
2
|
||||
],
|
||||
"categories": [1, 2],
|
||||
"tags": [],
|
||||
"target": {
|
||||
"target_name": "bilibili_name",
|
||||
|
@ -26,10 +26,7 @@
|
||||
},
|
||||
"subs": [
|
||||
{
|
||||
"tags": [
|
||||
"kaltsit",
|
||||
"amiya"
|
||||
],
|
||||
"tags": ["kaltsit", "amiya"],
|
||||
"target": {
|
||||
"target_name": "weibo_name",
|
||||
"target": "weibo_id",
|
||||
@ -38,10 +35,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"categories": [
|
||||
1,
|
||||
2
|
||||
],
|
||||
"categories": [1, 2],
|
||||
"tags": [],
|
||||
"target": [
|
||||
{
|
||||
|
@ -27,10 +27,7 @@
|
||||
"subs": [
|
||||
{
|
||||
"categories": [],
|
||||
"tags": [
|
||||
"kaltsit",
|
||||
"amiya"
|
||||
],
|
||||
"tags": ["kaltsit", "amiya"],
|
||||
"target": {
|
||||
"target_name": "weibo_name",
|
||||
"target": "weibo_id",
|
||||
@ -39,10 +36,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"categories": [
|
||||
1,
|
||||
2
|
||||
],
|
||||
"categories": [1, 2],
|
||||
"tags": [],
|
||||
"target": {
|
||||
"target_name": "bilibili_name",
|
||||
@ -70,13 +64,8 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"categories": [
|
||||
2,
|
||||
6
|
||||
],
|
||||
"tags": [
|
||||
"poca"
|
||||
],
|
||||
"categories": [2, 6],
|
||||
"tags": ["poca"],
|
||||
"target": {
|
||||
"target_name": "weibo_name2",
|
||||
"target": "weibo_id2",
|
||||
|
@ -9,16 +9,14 @@ from .utils import fake_admin_user, fake_private_message_event
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_command(app: App):
|
||||
|
||||
from nonebot.adapters.onebot.v11.bot import Bot
|
||||
from nonebot.adapters.onebot.v11.message import Message
|
||||
|
||||
from nonebot_bison.plugin_config import plugin_config
|
||||
from nonebot_bison.admin_page import register_get_token_handler
|
||||
from nonebot_bison.admin_page.token_manager import token_manager as tm
|
||||
from nonebot_bison.plugin_config import plugin_config
|
||||
|
||||
with patch.object(tm, "get_user_token", return_value="test_token"):
|
||||
|
||||
register_get_token_handler()
|
||||
|
||||
async with app.test_matcher() as ctx:
|
||||
@ -30,27 +28,21 @@ async def test_command(app: App):
|
||||
to_me=True,
|
||||
)
|
||||
ctx.receive_event(bot, event_1)
|
||||
ctx.should_call_send(
|
||||
event_1, f"请访问: {plugin_config.bison_outer_url}auth/test_token", True
|
||||
)
|
||||
ctx.should_call_send(event_1, f"请访问: {plugin_config.bison_outer_url}auth/test_token", True)
|
||||
ctx.should_finished()
|
||||
|
||||
event_2 = fake_private_message_event(
|
||||
message=Message("管理后台"), sender=fake_admin_user, to_me=True
|
||||
)
|
||||
event_2 = fake_private_message_event(message=Message("管理后台"), sender=fake_admin_user, to_me=True)
|
||||
ctx.receive_event(bot, event_2)
|
||||
ctx.should_call_send(
|
||||
event_2, f"请访问: {plugin_config.bison_outer_url}auth/test_token", True
|
||||
)
|
||||
ctx.should_call_send(event_2, f"请访问: {plugin_config.bison_outer_url}auth/test_token", True)
|
||||
ctx.should_finished()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_log(app: App, tmp_path: Path):
|
||||
import contextlib
|
||||
import io
|
||||
import contextlib
|
||||
|
||||
from nonebot.log import default_format, logger
|
||||
from nonebot.log import logger, default_format
|
||||
|
||||
from nonebot_bison.admin_page import init_fastapi
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user