Skip to main content

Fortune divination!

Reason this release was yanked:

同v0.3.2bug

Project description

Fortune

🙏 今日运势 🙏

版本

v0.3.0

⚠ 适配nonebot2-2.0.0beta.1;适配alpha.16参见alpha.16分支

安装

  1. 安装方式注意:

    • 通过pipnb:版本指定^0.3.0,pypi无法发行过大安装包,由此安装的插件不包含所有resource下所有主题抽签资源,需单独下载,建议zip包下载后单独提取resource资源,后更改FORTUNE_PATH配置即可;

    • 通过zipgit clone安装:包含resource下所有主题抽签资源;

  2. 抽签签底img、字体font、文案fortune等资源位于./resource下,可在env下设置FORTUNE_PATH更改;

FORTUNE_PATH="your_path_to_resource"   # 默认位于os.path.join(os.path.dirname(__file__), "resource"),具体查看data_source.py
  1. 新增 更多抽签主题,在env下设置xxx_FLAG以启用或关闭抽签随机主题,例如:
ARKNIGHTS_FLAG = true         # 明日方舟
ASOUL_FLAG = true             # A-SOUL
AZURE_FLAG = true             # 碧蓝航线
GENSHIN_FLAG = true           # 原神
ONMYOJI_FLAG = true           # 阴阳师
PCR_FLAG = true               # 公主链接
TOUHOU_FLAG = true            # 东方
TOUHOU_OLD_FLAG = true        # 东方旧版
VTUBER_FLAG = true            # Vtuber
PUNISHING_FLAG = true         # 战双帕弥什
GRANBLUE_FANTASY_FLAG = true  # 碧蓝幻想
PRETTY_DERBY_FLAG = true      # 赛马娘
  1. 新增./resource/fortune_setting.json内配置指定抽签规则,例如:
{
    "group_rule": {
        "123456789": "random",
        "987654321": "azure",
        "123454321": "granblue_fantasy"
    },
    "specific_rule": {
        "凯露": [
            "pcr\/frame_1.jpg",
            "pcr\/frame_2.jpg"
        ],
        "可可萝": [
            "pcr\/frame_41.jpg"
        ]
    }
}

group_rule会自动生成,specific_rule可手动配置

指定凯露签,由于存在两张凯露的签底,配置凯露签的路径列表即可,其余类似;目前仅能通过json配置规则;

  1. 占卜一下你的今日运势!🎉

功能

  1. 随机抽取今日运势,配置更多种抽签主题:原神、PCR、Vtuber、东方、明日方舟、旧版东方、赛马娘、阴阳师、碧蓝航线、碧蓝幻想、战双帕弥什……

  2. 可配置随机抽签主题或指定主题,也可指定角色签底(例如可莉、魔理沙、凯露、阿夸🥰);

  3. 每群每人一天限抽签1次,0点刷新(贪心的人是不会有好运的🤗);

  4. 抽签的信息会保存在./resource/fortune_data.json内;群抽签设置及指定抽签规则保存在./resource/fortune_setting.json内;抽签生成的图片当天会保存在./resource/out下;

命令

  1. 一般抽签:今日运势、抽签、运势;

  2. 指定签底并抽签:指定[xxx]签,在./resource/fortune_setting.json内手动配置;

  3. [群管或群主或超管] 配置抽签主题:

    • 设置[原神/pcr/东方/vtb/xxx]签:设置群抽签主题;

    • 重置抽签:设置群抽签主题为随机;

  4. 抽签设置:查看当前群抽签主题的配置;

  5. 新增 [超管] 刷新抽签:可手动即刻刷新全局抽签is_divined值,当遇到未知错误导致过0点未刷新时手动刷新。

效果

测试效果出自群聊。

display

本插件改自

opqqq-plugin

抽签图片及文案资源

  1. opqqq-plugin:原神、pcr、vtb抽签主题;

  2. 感谢江樂丝提供东方签底;

  3. FloatTech-zbpdata/Fortune:其余主题签;

资源整合注意

  1. 抽签图片及文案资源下载参见上述出处链接;

  2. 本插件中未使用FloatTech-zbpdata/Fortune提供的全部主题签,其提供的text.json文案资源与opqqq-plugin提供的文案资源copywriting.jsongoodLuck.json略有不同,具体不同如下:

    • text.jsontitle(吉凶度设定)直接对应content(运势文案内容);

    • goodLuck.jsongood-luck(吉凶度编号)对应name(吉凶度设定);copywriting.jsongood-luck(吉凶度编号)对应content(运势文案内容);

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

nonebot_plugin_fortune-0.3.0.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

nonebot_plugin_fortune-0.3.0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_fortune-0.3.0.tar.gz.

File metadata

  • Download URL: nonebot_plugin_fortune-0.3.0.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0a2 CPython/3.8.10 Linux/5.4.0-96-generic

File hashes

Hashes for nonebot_plugin_fortune-0.3.0.tar.gz
Algorithm Hash digest
SHA256 c38a9455b582595475d1cf2a48593edf07cc63f3d89f796a29bc5d5cae88789b
MD5 c6f3d4c125167f20f763fb5cdcb917d7
BLAKE2b-256 5297ed42f07e440a089d82ab248641e334e9b0efea4d68a7a2173dccd1634e95

See more details on using hashes here.

Provenance

File details

Details for the file nonebot_plugin_fortune-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_fortune-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1bc94a6a843cc91b2af4c85008ba86e3ffb9cd8e4786da827edad0b3298a307c
MD5 4b72d6a20daa1513c3a8cff0e3d3d1b5
BLAKE2b-256 ff787b180e13c2de2bbc7e98ee27f18815715002c2cd0acf743bed27b6c90574

See more details on using hashes here.

Provenance

Supported by

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