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
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
File details
Details for the file starbot_bilibili_datasource-1.2.2.tar.gz
.
File metadata
- Download URL: starbot_bilibili_datasource-1.2.2.tar.gz
- Upload date:
- Size: 28.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.6 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a96e06b28a0b372e5155b5fdb729f96ca65d865ec8691d9ed3a32ec14b98917 |
|
MD5 | a616e8cd53556d6d330f097f210979bc |
|
BLAKE2b-256 | cba0ae016b2918b82e6b4f24c0f3de36bfe83543cad4e97c11ca371da5ed1679 |
File details
Details for the file starbot_bilibili_datasource-1.2.2-py3-none-any.whl
.
File metadata
- Download URL: starbot_bilibili_datasource-1.2.2-py3-none-any.whl
- Upload date:
- Size: 22.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.6 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 533c3ba1a8e5699a1fb202a2e9bf37b8efe5b93d1e2c2e8471ba14d36ff50c53 |
|
MD5 | d419c7a29fdfb0ee161fd73767da336f |
|
BLAKE2b-256 | da4c7f8ae819527907a5ee2032246ceba829c1cb4629f88ce34c916af35d1433 |