Skip to content

Commit 0739cc8

Browse files
author
KafCoppelia
committed
⚠适配alpha16版本
1 parent f2f883a commit 0739cc8

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

README.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<!-- prettier-ignore-start -->
66
<!-- markdownlint-disable-next-line MD036 -->
7-
_ 天天疯狂 _
7+
_🍗 天天疯狂 🍗_
88
<!-- prettier-ignore-end -->
99

1010
</div>
@@ -16,23 +16,25 @@ _✨ 天天疯狂 ✨_
1616
</a>
1717

1818
<a href="https://github.com/nonebot/nonebot2">
19-
<img src="https://img.shields.io/badge/nonebot2-2.0.0beta.1-green">
19+
<img src="https://img.shields.io/badge/nonebot2-2.0.0alpha.16-green">
2020
</a>
2121

2222
<a href="">
23-
<img src="https://img.shields.io/badge/release-v0.1.4-orange">
23+
<img src="https://img.shields.io/badge/release-v0.1.5-orange">
2424
</a>
2525

2626
</p>
2727
</p>
2828

2929
## 版本
3030

31-
v0.1.4
31+
v0.1.5
32+
33+
⚠ 适配nonebot2-2.0.0alpha.16,适配beta.1版本将会放在dev分支。
3234

3335
## 安装
3436

35-
1. 通过`pip``poetry`安装;
37+
1. 通过`pip``nb`安装;
3638

3739
2. 读取文案的默认路径位于`./resource`下;
3840

@@ -42,7 +44,7 @@ v0.1.4
4244

4345
## 命令
4446

45-
1. 疯狂星期[一|二|三|四|五|六|日]
47+
1. 天天疯狂,疯狂星期[一|二|三|四|五|六|日]
4648
2. 输入**疯狂星期八**等不合法时间将提示;
4749

4850
## 本插件改自HoshinoBot疯狂星期四插件

nonebot_plugin_crazy_thursday/__init__.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
11
from nonebot.typing import T_State
2-
from nonebot.params import State
32
import random
43
import json
54
import os
65
import re
76
import nonebot
8-
from nonebot import logger
9-
from nonebot import on_command, on_regex
10-
from nonebot.adapters.onebot.v11 import Bot, GroupMessageEvent, GROUP
7+
from nonebot import on_regex
8+
from nonebot.adapters.cqhttp import Bot, GroupMessageEvent, GROUP
119

1210
_CRAZY_PATH = nonebot.get_driver().config.crazy_path
1311
CRAZY_PATH = os.path.join(os.path.dirname(__file__), "resource") if not _CRAZY_PATH else _CRAZY_PATH
1412
# crazy = on_command('疯狂星期四', aliases={"星期四", "KFC", "V我50"}, permission=GROUP, priority=15, block=True)
1513
crazy = on_regex(r'疯狂星期.', permission=GROUP, priority=15, block=True)
1614

1715
@crazy.handle()
18-
async def random_post(bot: Bot, event: GroupMessageEvent, state: T_State = State()):
16+
async def random_post(bot: Bot, event: GroupMessageEvent, state: T_State):
1917
iscrazy = re.search(r'(.*?)星期[一|二|三|四|五|六|日]', event.get_plaintext())
2018
crazy_day = iscrazy.group(0)[-3:] if iscrazy is not None else None
2119
if crazy_day is None:
2220
await crazy.finish("给个准确时间,OK?")
2321

2422
# json数据存放路径
25-
filePath = os.path.join(CRAZY_PATH, 'post.json')
23+
filePath = os.path.join(CRAZY_PATH, "post.json")
2624
# 将json对象加载到数组
2725
kfc = json.load(open(filePath, 'r', encoding="UTF-8")).get('post')
2826
# 随机选取数组中的一个对象

poetry.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "nonebot_plugin_crazy_thursday"
3-
version = "0.1.4"
3+
version = "0.1.5"
44
description = "Send crazy thursday articles of KFC randomly!"
55
authors = ["KafCoppelia <k740677208@gmail.com>"]
66
license = "MIT"

0 commit comments

Comments
 (0)