Skip to main content

NoneBot-Plugin-Wakatime

✨ NoneBot Wakatime 查询插件 ✨

pypi python pdm-managed alc-resolved
NoneBot Registry Supported Adapters
📸 演示与预览   |   📦️ 下载插件   |   💬 加入交流群

📖 介绍

NoneBot Wakatime 查询插件。将你的代码统计嵌入 Bot 中

starify
Star History

💿 安装

以下提到的方法任选 其一 即可

[推荐] 使用 nb-cli 安装 在 Bot 的根目录下打开命令行, 输入以下指令即可安装
nb plugin install nonebot-plugin-wakatime
使用包管理器安装
pip install nonebot-plugin-wakatime
# or, use poetry
poetry add nonebot-plugin-wakatime
# or, use pdm
pdm add nonebot-plugin-wakatime

打开 NoneBot 项目根目录下的配置文件, 在 [plugin] 部分追加写入

plugins = ["nonebot_plugin_wakatime"]

⚙️ 配置

在项目的配置文件中添加下表中配置

配置项 必填 默认值
wakatime__client_id 是 无
wakatime__client_secret 是 无
wakatime__redirect_uri 是 无
wakatime__api_url 否 https://wakatime.com/api/v1
wakatime__register_route 否 /wakatime/register
wakatime__background_source 否 default
wakatime__enable_qq_button 否 False

暗语配置:

配置项 必填 默认值
wakatime_argot__command 否 background
wakatime_argot__expire 否 300

redirect_uri

使用 WakaTime 域名

  • 在 WakaTime App 中的 Authorized Redirect URIs 添加:https://wakatime.com/oauth/test

  • 在项目配置文件中写入:

    wakatime__redirect_uri = https://wakatime.com/oauth/test
    

使用个人域名

  • 使用 nb-cli 安装服务端类型驱动器并修改配置文件

  • 在 WakaTime App 中的 Authorized Redirect URIs 添加:https://<your-domain:PORT>/wakatime/register

  • 在项目配置文件中写入:

    wakatime__redirect_uri = https://<your-domain:PORT>/wakatime/register
    

background_source

wakatime__background_source 为背景图来源,可选值为字面量 default / LoliAPI / Lolicon 或者结构 CustomSource 。LoliAPI 和 Lolicon 均为随机背景图,CustomSource 用于自定义背景图。 默认为 default。

以下是 CustomSource 用法

在配置文件中设置 wakatime__background_source 为 CustomSource结构的字典

wakatime__background_source = '{"uri": "https://example.com/image.jpg"}'

其中

  • uri 可为网络图片 API,只要返回的是图片即可
  • uri 也可以为 base64 编码的图片,如 data:image/png;base64,xxxxxx (一般也没人这么干)
  • uri 也可以为本地图片路径,如 imgs/image.jpg、/path/to/image.jpg
    • 如果本地图片路径是相对路径,会使用 nonebot-plugin-localstore 指定的 data 目录作为根目录
    • 如果本地图片路径是目录,会随机选择目录下的一张图片作为背景图

🎉 使用

绑定账号

首次绑定时向 Bot 发送 /wakatime bind,跟随链接指引进行绑定,成功后会跳转到 redirect_uri 处。

/wakatime bind [code]

解绑

/wakatime revoke

查询信息

/wakatime [@]

订阅

默认订阅为 weekly
取消订阅在指令后加 -r|--revoke 即可

/wakatime subscribe ['weekly' | 'monthly' | 'yearly']

📸 效果图

默认背景图

rendering

💖 鸣谢

贡献者们

All Contributors

感谢这些大佬对本项目作出的贡献:

Komorebi
Komorebi

💻
Azide
Azide

💻
Jigsaw
Jigsaw

💻
wyf7685
wyf7685

🐛 💻

本段符合 all-contributors 规范

📄 许可证

本项目使用 MIT 许可证开源

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Metadata

Release files for nonebot-plugin-wakatime 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nonebot-plugin-wakatime 0.3.1
File Size Uploaded Provenance Actions
nonebot_plugin_wakatime-0.3.1.tar.gz 9.8 MB Without provenance Details for nonebot_plugin_wakatime-0.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nonebot-plugin-wakatime 0.3.1
File Interpreter ABI Platform Actions
nonebot_plugin_wakatime-0.3.1-py3-none-any.whl Python 3 none any Details for nonebot_plugin_wakatime-0.3.1-py3-none-any.whl

Total release size: 18.8 MB

Release files / nonebot_plugin_wakatime-0.3.1.tar.gz

Download URL nonebot_plugin_wakatime-0.3.1.tar.gz
Size 9.8 MB
Tags Source
SHA-256 checksum
How to use checksums
f857c14670b7af5c71c76e9e9d5c39bc7e9a8a5d702a6baf59178532bdaa492f
BLAKE2b-256 checksum
How to use checksums
1663645c702ccc9feb184010e2ad7fa89b0d341e87a6ce1757157b6cc8e7ca43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / nonebot_plugin_wakatime-0.3.1-py3-none-any.whl

Download URL nonebot_plugin_wakatime-0.3.1-py3-none-any.whl
Size 9.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
996b4c1b123f900cd765dc2ec03e561824baec9f5ebd6cf59664ff419f9301df
BLAKE2b-256 checksum
How to use checksums
42414d493dce82d108040b75f01da836fafd9d0c38661fd79d767bff75cdfdc9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Security for nonebot-plugin-wakatime 0.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page