Skip to main content

用于每日定时签到森空岛明日方舟的Nonebot插件

Project description

NoneBotPluginLogo

NoneBotPluginText

nonebot-plugin-skland-arksign

✨ 用于每日早八定时签到森空岛明日方舟的Nonebot插件 ✨

license pypi python

💿 安装

根据数美 device ID 获取的方法的不同,可选择以下版本(区别下述):

nb plugin install nonebot-plugin-skland-arksign
nb plugin install nonebot-plugin-skland-arksign[sm_local]
nb plugin install nonebot-plugin-skland-arksign[sm_htmlrender]

🎉 使用

插件命令名为skland, 可用别名:sklskd森空岛

配置

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

配置项 类型 必填 默认值 说明
skland_arksign_allow_group bool False 允许群组等私信用户以上的对话模型注册模型而不会警告 请在私聊中使用 字样
  • 在群聊中使用命令时,命令的权限会受到较大限制
  • skland_timestamp_delay int 2 针对bot所在机器调整bot生成森空岛签名时进行运算的减数
    skland_use_web_timestamp bool False 无法调到合适的timestamp_delay时使用的方案
    skland_sm_method_identifier int 0 数美Device ID / dId 的获取方式
    skland_sm_api_endpoint str ... 选用 retrieval-server api 时的 URL路径,可自行部署
    htmlrender-... ... ... ... 选用 htmlrender 时该插件的相关配置

    关于数美Device ID / dId 的配置

    2024.09 起,yjwl在获取 cred 的部分接入了 阿里云 Web 应用防火墙,导致全网项目拉闸

    在监狱待着顺便蹲网上大佬们的成果后本插件提供以下几种应对措施:

    retrieval-server api(编号0

    采用 Koajs + Nodejs VM 的 API 方案,不需要额外安装依赖。

    库:GuGuMur/skland-did-retrieval-server

    安装:nb plugin install nonebot-plugin-skland-arksign

    配置:skland_sm_method_identifier = 0

    Python 实现原生模拟 (编号1

    市面上几乎所有森空岛签到项目的蓝本大佬 FancyCabbage(Gitee)对数美 SDK 逆向后使用Python 实现。

    额外安装库cryptography

    代码协议MIT

    安装:nb plugin install nonebot-plugin-skland-arksign[sm_local]

    配置:skland_sm_method_identifier = 1

    HTMLRender / Playwright 模拟 (编号2

    灵感来自 ztmzzz/skyland_auto_sign_qinglong ,通过模拟浏览器环境获取dId

    额外安装插件nonebot-plugin-htmlrender

    安装:nb plugin install nonebot-plugin-skland-arksign[sm_htmlrender]

    配置:skland_sm_method_identifier = 2

    新增账号

    skland add [游戏账号ID] [森空岛token] [-n 可选备注]
    

    [!IMPORTANT] 游戏账号ID为游戏主界面博士名下面那串数字(如114514

    在群聊中使用时,一定不要带上token,否则会有盗号风险

    缺少的token会在私聊中补充:使用 bind 命令

    获取Token

    1. 登录森空岛

    2. 访问这个网址

      返回如下信息

      {
        "code": 0,
        "data": {
          "content": "<Token>"
        },
        "msg": "接口会返回您的鹰角网络通行证账号的登录凭证,此凭证可以用于鹰角网络账号系统校验您登录的有效性。泄露登录凭证属于极度危险操作,为了您的账号安全,请勿将此凭证以任何形式告知他人!"
      }
      
    3. <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

    1. 为什么这么多仅超级用户可用的命令? 因为当前的数据库模型没有记录添加者的信息,只记录了需要发送到的用户信息,所以暂时只能通过超级用户来操作 未来可能会加入权限系统,以及增加数据库模型字段

    2. 使用例子?

      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
      
    3. 为什么我刚获取token并绑定好,一会就用不了了?

    • 当您使用浏览器获取token时,不要去登出账号,否则鹰角网络通行证会失效!
    • 如果要添加多个账号,请删除浏览器缓存。或者使用浏览器自带的隐私浏览模式,拿到Token后,关闭隐私窗口,再登录一次即可
    • 注意:电脑在用密码登录后,手机客户端有可能会被挤掉,但一定不要点客户端里的清理会话,否则所有的登录状态都会被清空!
    1. 报错{'code': 10001, 'message': '当前用户未经授权'}
    1. 报错Client error '400 Bad Request' for url xxx
    • 请检查token复制过程中是否有错漏,以及游戏账号ID是否与您输入的token相符
    1. 报错Client error '401 Unauthorized' for url xxx
    • 参考 #配置 一栏修改skland_timestamp_delay的数值
      • 参考值:510
    • 修改 skland_use_web_timestamp 值为 True

    🤗 致谢

    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_skland_arksign-0.8.1.tar.gz (115.0 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_skland_arksign-0.8.1-py3-none-any.whl (116.7 kB view details)

    Uploaded Python 3

    File details

    Details for the file nonebot_plugin_skland_arksign-0.8.1.tar.gz.

    File metadata

    File hashes

    Hashes for nonebot_plugin_skland_arksign-0.8.1.tar.gz
    Algorithm Hash digest
    SHA256 4c788875fa1fbed12f33bc5a4f8f5437677ffc3c32cb3c41dff15697c50440b1
    MD5 a78ea5bd5ac35f36e27c2748077fd1fc
    BLAKE2b-256 0f403d457d97ae92f5dbbd926643e4f57ae3a08864182ee78371dbbe3a8a7a2c

    See more details on using hashes here.

    Provenance

    The following attestation bundles were made for nonebot_plugin_skland_arksign-0.8.1.tar.gz:

    Publisher: release.yml on GuGuMur/nonebot-plugin-skland-arksign

    Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

    File details

    Details for the file nonebot_plugin_skland_arksign-0.8.1-py3-none-any.whl.

    File metadata

    File hashes

    Hashes for nonebot_plugin_skland_arksign-0.8.1-py3-none-any.whl
    Algorithm Hash digest
    SHA256 c75c5251bdb886d0dc783bb7d10f789c96728b9141c5c8959ef54702978d4309
    MD5 43c9d36c63d7ea3c2a8496acfe6fef65
    BLAKE2b-256 2540405e633d0bdabc4ec34ad10eacef76e0dbf36dfca18015fcc67506eba1b9

    See more details on using hashes here.

    Provenance

    The following attestation bundles were made for nonebot_plugin_skland_arksign-0.8.1-py3-none-any.whl:

    Publisher: release.yml on GuGuMur/nonebot-plugin-skland-arksign

    Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

    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