用于每日定时签到森空岛明日方舟的Nonebot插件
Project description
💿 安装
使用 nb-cli 安装
在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装nb plugin install nonebot-plugin-skland-arksign
使用包管理器安装
在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令pip
pip install nonebot-plugin-skland-arksign
pdm
pdm add nonebot-plugin-skland-arksign
poetry
poetry add nonebot-plugin-skland-arksign
conda
conda install nonebot-plugin-skland-arksign
打开 nonebot2 项目根目录下的 pyproject.toml 文件, 在 [tool.nonebot] 部分追加写入
plugins = ["nonebot_plugin_skland_arksign"]
[!IMPORTANT] 如果想在 Python <= 3.9 的环境中使用,请选择
v0.5.8,这是最后一个支持 Python <= 3.9 的 Release
严格来说其实是第一个以及最后一个,因为之前的版本有不适用于非3.10以下的类型注解语法,为此专门发布的一个可用的支持版本对于其他非
v0.5.8版本,都有可能不兼容 Python <= 3.9
🎉 使用
插件命令名为skland, 可用别名:skl、skd、森空岛
配置
群聊中使用
在bot文件夹下的.env.dev文件中追加
skland_arksign_allow_group=True
这将允许群组等私信用户以上的对话模型注册模型而不会警告 请在私聊中使用 字样
[!IMPORTANT] 在群聊中使用命令时,命令的权限会受到较大限制
基本只有超级用户可以使用
新增账号
skland add [游戏账号ID] [森空岛token] [-n 可选备注]
[!IMPORTANT] 游戏账号ID为游戏主界面博士名下面那串数字(如
114514)在群聊中使用时,一定不要带上token,否则会有盗号风险
缺少的token会在私聊中补充:使用 bind 命令
获取Token
-
登录森空岛
-
访问这个网址
返回如下信息
{ "code": 0, "data": { "content": "<Token>" }, "msg": "接口会返回您的鹰角网络通行证账号的登录凭证,此凭证可以用于鹰角网络账号系统校验您登录的有效性。泄露登录凭证属于极度危险操作,为了您的账号安全,请勿将此凭证以任何形式告知他人!" }
-
将
<Token>填入命令中
[!NOTE] 例子: 游戏账号ID为114514,访问得到内容
"content": "1919810"则命令为
森空岛 add 114514 1919810
[!IMPORTANT] 注意不要把包裹
content内容的引号,或是页面返回的整个内容输入到命令中!
私信补充token
在群聊中添加uid后,私聊中对bot发送以下命令
skland bind 森空岛token
删除账号
skland del 游戏账号ID/备注
[!WARNING] 注意:非超级用户只可删除自己绑定的账号,超级用户可以删除bot数据库内所有账号
列出账号
skland list
[!WARNING] 仅超级用户可用
更新账号
skland update 游戏账号ID/备注 [-u 可选UID] [-t 可选token] [-n 可选备注]
[!WARNING] 仅超级用户可用
立即手动签到
特定用户
skland signin 游戏账号ID/备注
所有用户
skland signin !all
[!WARNING] 仅超级用户可用
签到全部用户时,会分发到原本对应的聊天目标
♿️ FAQ
-
为什么这么多仅超级用户可用的命令? 因为当前的数据库模型没有记录添加者的信息,只记录了需要发送到的用户信息,所以暂时只能通过超级用户来操作 未来可能会加入权限系统,以及增加数据库模型字段
-
使用例子?
skland add 114514 1919810 -n hhhaaa skland add 114514 1919810 skland add 114514 skland del 114514 skland del hhhaaa skland list skland update 114514 -u 1919810 -n hhhaaaaa skland update hhhaaaaa -t 0189191 skland signin 1919810
-
为什么我刚获取token并绑定好,一会就用不了了?
- 当您使用浏览器获取token时,不要去登出账号,否则鹰角网络通行证会失效!
- 如果要添加多个账号,请删除浏览器缓存。或者使用浏览器自带的隐私浏览模式,拿到Token后,关闭隐私窗口,再登录一次即可
- 注意:电脑在用密码登录后,手机客户端有可能会被挤掉,但一定不要点客户端里的清理会话,否则所有的登录状态都会被清空!
- 报错
{'code': 10001, 'message': '当前用户未经授权'}?
- 报错
Client error '400 Bad Request' for url xxx?
- 请检查token复制过程中是否有错漏,以及游戏账号ID是否与您输入的token相符
🤗 致谢
xxyz30/skyland-auto-sign(Github/Gitee)、Yanstory/skland-checkin-ghaction、Maojuan-lang/SenKongDao:感谢以上项目提供的参考!AzideCupric:感谢大佬的技术支持!orzhe0119/nonebot-plugin-datastore:超好用的数据存储插件!MountainDash/nonebot-plugin-send-anything-anywhere:峯驰物流部门的全能转接信使!noneplugin/nonebot-plugin-session:全能的账单会话模型管理员!nonebot/plugin-alconna:比argparse好用十倍甚至九倍的命令行解析器!
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nonebot_plugin_skland_arksign-0.6.2.tar.gz.
File metadata
- Download URL: nonebot_plugin_skland_arksign-0.6.2.tar.gz
- Upload date:
- Size: 16.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: pdm/2.10.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c536191c73b6aafdc5e8ddd2aeb5b48bda28f47cbbe1b5db8454fd22d0a12e8
|
|
| MD5 |
9a6e381fa0375504375599cf52411abd
|
|
| BLAKE2b-256 |
35e8e6b465dcad563404fabd208c472f3a8fa10a418c08195c88551a8980c1bd
|
File details
Details for the file nonebot_plugin_skland_arksign-0.6.2-py3-none-any.whl.
File metadata
- Download URL: nonebot_plugin_skland_arksign-0.6.2-py3-none-any.whl
- Upload date:
- Size: 18.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: pdm/2.10.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b1d9238d4aa239c11f738a69f62ed017867d5ca5f8d1c3f989d1b04804df665
|
|
| MD5 |
776404818cc8457deba7ee95e8e1f160
|
|
| BLAKE2b-256 |
c898f4705f28c3bd7f9334359364e41c56b89c17d317105a8cfd985b8dc01f4a
|