Skip to main content

StarBot 推送配置数据源

Project description

StarBotDataSource

PyPI Python License STARS

StarBot 推送配置数据源

用途

  • 已内置 JSON 数据源(JsonDataSource) 实现
  • 可自行实现其他来源的推送配置数据源

快速开始

安装

pip install starbot-bilibili-datasource

开发

通过继承抽象类 DataSource 并实现其中的 load 抽象方法,即可实现其他来源的推送配置数据源

from typing import NoReturn

from loguru import logger
from starbot_datasource import DataSource


class CustomDataSource(DataSource):
    """
    自定义推送配置数据源实现
    """
    async def load(self) -> NoReturn:
        """
        初始化配置
        """
        if self.ups:
            return

        logger.info("已选用 自定义来源 作为 Bot 数据源")
        logger.info("开始从 自定义来源 中初始化 Bot 配置")
        
        # 在此实现初始化逻辑
        pass

        logger.success(f"成功从 自定义来源 中导入了 {len(self.ups)} 个 UP 主")

相关项目

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

starbot_bilibili_datasource-1.2.2.tar.gz (28.1 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file starbot_bilibili_datasource-1.2.2.tar.gz.

File metadata

File hashes

Hashes for starbot_bilibili_datasource-1.2.2.tar.gz
Algorithm Hash digest
SHA256 1a96e06b28a0b372e5155b5fdb729f96ca65d865ec8691d9ed3a32ec14b98917
MD5 a616e8cd53556d6d330f097f210979bc
BLAKE2b-256 cba0ae016b2918b82e6b4f24c0f3de36bfe83543cad4e97c11ca371da5ed1679

See more details on using hashes here.

File details

Details for the file starbot_bilibili_datasource-1.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for starbot_bilibili_datasource-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 533c3ba1a8e5699a1fb202a2e9bf37b8efe5b93d1e2c2e8471ba14d36ff50c53
MD5 d419c7a29fdfb0ee161fd73767da336f
BLAKE2b-256 da4c7f8ae819527907a5ee2032246ceba829c1cb4629f88ce34c916af35d1433

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page