Skip to main content

Steam 好友状态播报 NoneBot 插件

Project description

Nonebot-Plugin-Steam-Info

✨ Steam 好友状态播报 NoneBot 插件 ✨

介绍

这是一个基于 NoneBot2 的 Steam 好友状态播报插件,拥有绑定 Steam ID,查询群友状态,展示个人 Steam 主页等功能,支持跨平台,画图部分 100% 使用 Pillow 实现,较无头浏览器渲染更加轻量高效

功能

  • 绑定 Steam ID
  • 群友状态变更播报
  • 群友游戏时间播报
  • 主动查询群友状态
  • 展示个人 Steam 主页

预览

仿照了 Steam 好友列表的样式

图 1. 全部播报 image

图 2. 部分播报 image

图 3. 个人 Steam 主页 image

使用

命令 别名 说明
steambind [Steam ID 或 Steam好友代码] 绑定steam 绑定 Steam
steamunbind 解绑steam 解绑 Steam
steaminfo (可选)[@某人 或 Steam ID 或 Steam好友代码] steam信息 查看个人主页
steamcheck 查看steam, 查steam 查询群友 Steam 状态
steamupdate [名称] [图片] 更新群信息 更新群聊头像和名称
steamenable 启用steam 启用群友状态播报
steamdisable 禁用steam 禁用群友状态播报
steamnickname [昵称] steam昵称 设置 Steam 玩家昵称,用于辨识 Steam 名称与群昵称不一致的群友

记得加上你配置的命令头哦

安装方法

使用 nb-cli 安装 在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
nb plugin install nonebot-plugin-steam-info
使用包管理器安装 在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
pip
pip install nonebot-plugin-steam-info
pdm
pdm add nonebot-plugin-steam-info
poetry
poetry add nonebot-plugin-steam-info
conda
conda install nonebot-plugin-steam-info

打开 nonebot2 项目根目录下的 pyproject.toml 文件, 在 [tool.nonebot] 部分追加写入

plugins = ["nonebot_plugin_steam_info"]

配置

在 .env 文件中配置以下内容

配置项 默认值 说明
STEAM_API_KEY Steam API Key,可以是一个字符串,也可以是一列表的字符串,即支持多个API Key,在 此处 获取
PROXY 代理地址
STEAM_REQUEST_INTERVAL 300 Steam 请求间隔 & 播报间隔。单位为秒
STEAM_BROADCAST_TYPE "part" 播报类型。"part" 为部分播报(图 2),"all" 为全部播报(图 1),"none" 为只播报文字消息
STEAM_DISABLE_BROADCAST_ON_STARTUP False Bot 启动时是否禁用播报
STEAM_FONT_REGULAR_PATH fonts/MiSans-Regular.ttf Regular 字体相对目录
STEAM_FONT_LIGHT_PATH fonts/MiSans-Light.ttf Light 字体相对目录
STEAM_FONT_BOLD_PATH fonts/MiSans-Bold.ttf Bold 字体相对目录

最后再把仓库中 fonts 文件夹放到 Bot 的 运行目录 下,配置就完毕啦

在默认配置下,项目结构大致如下:

your_project/
├── bot.py
├── .env.*
├── fonts/
│   ├── MiSans-Regular.ttf
│   ├── MiSans-Light.ttf
│   └── MiSans-Bold.ttf
└── ...

这里使用了 MiSans 字体,感谢 MiSans

如果你希望使用其他字体,请参考配置版块。

如果配置中不填写 font/,则会在your_project/下寻找字体文件。

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

nonebot_plugin_steam_info-1.3.4.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nonebot_plugin_steam_info-1.3.4-py3-none-any.whl (1.3 MB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_steam_info-1.3.4.tar.gz.

File metadata

  • Download URL: nonebot_plugin_steam_info-1.3.4.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.21.0 CPython/3.10.12 Linux/6.5.0-1025-azure

File hashes

Hashes for nonebot_plugin_steam_info-1.3.4.tar.gz
Algorithm Hash digest
SHA256 bc68667e9e1f832cc15cfdf73beed8d6ee40cf33258699b3ceed1ba1e43ddbbc
MD5 375335b50d698c5b45b96aab586abc3e
BLAKE2b-256 2c4c67093b38d838efcd3e779e82f4102e656f1676c831847870f02dcc5e9c34

See more details on using hashes here.

File details

Details for the file nonebot_plugin_steam_info-1.3.4-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_steam_info-1.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 35cdbd359aa851007cc35c99889f8656571608982a1d977ae4e26bdad06c39f0
MD5 08ff5d6b9c7e43ee2c291e516bdc81d4
BLAKE2b-256 7f68cf4fdc675aedd01a891492adb168b41cc8bbe9bf3262f345bb7accb765ae

See more details on using hashes here.

Supported by

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