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.1.tar.gz (28.1 kB view hashes)

Uploaded Source

Built Distribution

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