Skip to content

Commit a597ba5

Browse files
author
KafCoppelia
committed
添加beta.1版本适配
1 parent 0739cc8 commit a597ba5

File tree

4 files changed

+882
-12
lines changed

4 files changed

+882
-12
lines changed

README.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,25 @@ _🍗 天天疯狂 🍗_
1616
</a>
1717

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

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

2626
</p>
2727
</p>
2828

2929
## 版本
3030

31-
v0.1.5
31+
v0.2.0
3232

33-
⚠ 适配nonebot2-2.0.0alpha.16,适配beta.1版本将会放在dev分支。
33+
⚠ 适配nonebot2-2.0.0beta.1;适配alpha.16版本参见[alpha.16分支](https://github.com/KafCoppelia/nonebot_plugin_crazy_thursday/tree/alpha.16)
3434

3535
## 安装
3636

37-
1. 通过`pip``nb`安装;
37+
1. 通过`pip``nb`安装,版本请指定`^0.2.0`
3838

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

@@ -45,6 +45,7 @@ v0.1.5
4545
## 命令
4646

4747
1. 天天疯狂,疯狂星期[一|二|三|四|五|六|日]
48+
4849
2. 输入**疯狂星期八**等不合法时间将提示;
4950

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

nonebot_plugin_crazy_thursday/__init__.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1-
from nonebot.typing import T_State
21
import random
32
import json
43
import os
54
import re
65
import nonebot
6+
from nonebot.typing import T_State
7+
from nonebot.params import State
78
from nonebot import on_regex
8-
from nonebot.adapters.cqhttp import Bot, GroupMessageEvent, GROUP
9+
from nonebot.adapters.onebot.v11 import Bot, GroupMessageEvent, GROUP
910

1011
_CRAZY_PATH = nonebot.get_driver().config.crazy_path
1112
CRAZY_PATH = os.path.join(os.path.dirname(__file__), "resource") if not _CRAZY_PATH else _CRAZY_PATH
12-
# crazy = on_command('疯狂星期四', aliases={"星期四", "KFC", "V我50"}, permission=GROUP, priority=15, block=True)
13+
14+
# V我50
1315
crazy = on_regex(r'疯狂星期.', permission=GROUP, priority=15, block=True)
1416

1517
@crazy.handle()
16-
async def random_post(bot: Bot, event: GroupMessageEvent, state: T_State):
18+
async def _(bot: Bot, event: GroupMessageEvent, state: T_State=State()):
1719
iscrazy = re.search(r'(.*?)星期[一|二|三|四|五|六|日]', event.get_plaintext())
1820
crazy_day = iscrazy.group(0)[-3:] if iscrazy is not None else None
1921
if crazy_day is None:

0 commit comments

Comments
 (0)