Skip to main content

查询sues账单

Project description

logo

✨ nonebot-plugin-sues-bill ✨

LICENSE pypi python uv
ruff pre-commit

📖 介绍

SUES 校园服务插件,支持查询上海工程技术大学电费和校园卡余额。

主要功能:

  • 🔌 电费查询 — 查询宿舍剩余电量,支持记忆上次查询参数
  • 📊 昨日耗电 — 自动结算昨日耗电量与电费,支持缴费流水校正
  • 💳 校园卡查询 — 查询校园卡账户余额和冻结余额

💿 安装

使用 nb-cli 安装 在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
nb plugin install nonebot-plugin-sues-bill --upgrade

使用 pypi 源安装

nb plugin install nonebot-plugin-sues-bill --upgrade -i "https://pypi.org/simple"

使用清华源安装

nb plugin install nonebot-plugin-sues-bill --upgrade -i "https://pypi.tuna.tsinghua.edu.cn/simple"
使用包管理器安装 在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
uv
uv add nonebot-plugin-sues-bill

安装仓库 master 分支

uv add git+https://github.com/noel-psc/nonebot-plugin-sues-bill@main
pdm
pdm add nonebot-plugin-sues-bill

安装仓库 master 分支

pdm add git+https://github.com/noel-psc/nonebot-plugin-sues-bill@main
poetry
poetry add nonebot-plugin-sues-bill

安装仓库 master 分支

poetry add git+https://github.com/noel-psc/nonebot-plugin-sues-bill@main

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

plugins = ["nonebot_plugin_sues_bill"]
使用 nbr 安装(使用 uv 管理依赖可用)

nbr 是一个基于 uv 的 nb-cli,可以方便地管理 nonebot2

nbr plugin install nonebot-plugin-sues-bill

使用 pypi 源安装

nbr plugin install nonebot-plugin-sues-bill -i "https://pypi.org/simple"

使用清华源安装

nbr plugin install nonebot-plugin-sues-bill -i "https://pypi.tuna.tsinghua.edu.cn/simple"

⚙️ 配置

在 nonebot2 项目的.env文件中添加下表中的配置项(可选)

配置项 必填 默认值 说明
sues_base_url https://epay.sues.edu.cn SUES 一卡通系统地址
sues_electricity_price_per_kwh 0.617 每度电价格(元),用于计算昨日电费

🎉 使用

指令表

电费查询

指令 权限 需要@ 范围 说明
#电费 群员 私聊/群聊 查询宿舍电费(使用上次保存的参数)
#电费 区域 楼栋 房间号 群员 私聊/群聊 查询指定宿舍电费
#昨日耗电 群员 私聊/群聊 查询昨日耗电量与电费
#电费帮助 群员 私聊/群聊 查看电费查询帮助
#电费详细帮助 群员 私聊/群聊 查看详细参数说明
#清除电费设置 群员 私聊/群聊 清除保存的查询参数
支持的区域和楼栋

三期学生公寓:10-26栋 四期学生公寓:20、21、23、24、27-30、33-36、39-42栋

示例:

#电费 三期 21 1001
#电费 四期 28 1021

昨日耗电

首次成功执行 #电费 后,插件会保存该用户的宿舍参数。每天会在上海时区 00:00 前后十分钟内,为已保存参数的用户错峰查询一次剩余电量,并结算前一自然日的耗电量和电费。

  • 已私聊设置校园卡账号的用户:插件会读取当天成功的“电费缴费”流水,按 昨日 00:00 余额 + 缴费购电量 - 今日 00:00 余额 校正耗电量。
  • 未设置校园卡账号的用户:按两次余额差显示估算值;若发现余额增加,会提示当天可能发生缴费,无法准确计算。
  • 首次记录需要等待两个日界快照后才能得到昨日耗电。
  • 为降低对学校系统的集中访问,日界采样会有最多十分钟的边界误差。

数据保存在 nonebot-plugin-localstore 的插件专属目录。旧版本若曾将数据保存到全局 data/,升级后会在首次访问时自动迁移用户配置及加密密钥。

校园卡查询

指令 权限 需要@ 范围 说明
#校园卡 群员 私聊/群聊 查询校园卡余额
#校园卡帮助 群员 私聊/群聊 查看校园卡帮助
#设置校园卡账号 学号 密码 群员 仅私聊 设置校园卡账号(密码加密存储)

⚠️ 安全提示:校园卡账号仅限私聊设置(#设置校园卡账号),密码使用 Fernet 加密后存储在本地。

🎨 效果图

电费查询

剩余电量: 128.5 度

昨日耗电

昨日耗电:2.5 度
昨日电费:1.54 元

校园卡查询

💳 校园卡余额
━━━━━━━━━━━━
账户余额: ¥128.50
冻结余额: ¥0.00

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_sues_bill-1.0.7.tar.gz (194.1 kB view details)

Uploaded Source

Built Distribution

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

nonebot_plugin_sues_bill-1.0.7-py3-none-any.whl (27.6 kB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_sues_bill-1.0.7.tar.gz.

File metadata

  • Download URL: nonebot_plugin_sues_bill-1.0.7.tar.gz
  • Upload date:
  • Size: 194.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for nonebot_plugin_sues_bill-1.0.7.tar.gz
Algorithm Hash digest
SHA256 ec93616c102f693615d0de903f9a3a24a242bdca57f4180124b2255f75088fb8
MD5 4cc021213867f38379763b2f41cf4cd6
BLAKE2b-256 753e80759b514244256f23776a3453e59b95b58a3e45aa7a00ee4069ae5ac05f

See more details on using hashes here.

File details

Details for the file nonebot_plugin_sues_bill-1.0.7-py3-none-any.whl.

File metadata

  • Download URL: nonebot_plugin_sues_bill-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 27.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for nonebot_plugin_sues_bill-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 20cdaf74379c643173bf832296a8e4425b60ccd440a53dbe9ae2520a0e39e258
MD5 6e939b4816159e3817a0286489d1cc15
BLAKE2b-256 a93e82dde0ee6bc2b5deccf1851d4701a462b907ad07554a7cd3ce0b157f46dc

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