StarBot 推送配置数据源
Project description
用途
- 已内置 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 主")
相关项目
- StarBotExecutor: 一个基于订阅发布模式的异步执行器
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for starbot_bilibili_datasource-1.2.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74e827b5991c783aaf8ca7722f1216d6180a218b5f26a3e9e1f5353589d4e756 |
|
MD5 | 4cd6dc86db5d13d38f527a967f147ccf |
|
BLAKE2b-256 | 76120e32aa4e09f5cdf12fe2dd6033347ee4ffbf252bb8c997549bbb2580a1a0 |
Close
Hashes for starbot_bilibili_datasource-1.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 835acdb93db0f38efda3b84cf4f9dc4d5b034536fe7e8f736ae7de277260dd46 |
|
MD5 | 16775aacc841567d7f33fc51ea7c4dc0 |
|
BLAKE2b-256 | b9b23d8fa0f7a770abf529b467f6e47c26fecd45b426a5bd19607a67ea26a219 |