Skip to content

Commit

Permalink
v0.2.0a2发布🥳
Browse files Browse the repository at this point in the history
  • Loading branch information
KafCoppelia committed Feb 14, 2022
1 parent 128c8e6 commit 20cc422
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ _🌈 おはよう! 🌈_
</a>

<a href="">
<img src="https://img.shields.io/badge/release-v0.2.0alpha.1-orange">
<img src="https://img.shields.io/badge/release-v0.2.0alpha.2-orange">
</a>

</p>
Expand All @@ -28,15 +28,15 @@ _🌈 おはよう! 🌈_

## 版本

v0.2.0-alpha.1
v0.2.0-alpha.2

⚠ 适配nonebot2-2.0.0beta.1;适配alpha.16版本参见[alpha.16分支](https://github.com/KafCoppelia/nonebot_plugin_morning/tree/alpha.16)

[更新日志](https://github.com/KafCoppelia/nonebot_plugin_morning/releases/tag/v0.2.0-alpha.1)
[更新日志](https://github.com/KafCoppelia/nonebot_plugin_morning/releases/tag/v0.2.0-alpha.2)

## 安装

1. 通过`pip``nb`安装,该版本为**测试版**
1. 通过`pip``nb`安装,版本指定`0.2.0a2`该版本为**测试版**

2. 用户数据`data.json`及早晚安配置文件`config.json`位于`/resource`下,可在`env`内设置`MORNING_PATH`更改:

Expand Down
4 changes: 2 additions & 2 deletions nonebot_plugin_morning/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from nonebot.params import CommandArg
from .data_source import morning_manager

__morning_vsrsion__ = "0.2.0"
__morning_vsrsion__ = "v0.2.0a2"
plugin_notes = f'''
おはよう! v{__morning_vsrsion__}
おはよう! {__morning_vsrsion__}
[早安] 早安/哦嗨哟/おはよう
[晚安] 晚安/こんばん
[我的作息] 看看自己的作息
Expand Down
8 changes: 4 additions & 4 deletions nonebot_plugin_morning/data_source.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import nonebot
from nonebot.adapters.onebot.v11 import GroupMessageEvent
from typing import Optional, Union, List
from typing import Optional, Union, List, Tuple
from pathlib import Path
import datetime
import os
Expand Down Expand Up @@ -166,7 +166,7 @@ def change_config(self, day_or_night: str, server: str, enable: bool) -> str:
return msg

# 更改时间或间隔
def change_set_time(self, *args):
def change_set_time(self, *args) -> str:
try:
day_or_night = args[0]
server = args[1]
Expand Down Expand Up @@ -331,7 +331,7 @@ def judge_super_get_up(self, group_id: str, user_id: str, now_time: datetime.dat
return False

# 进行早安并更新数据
def morning_and_update(self, now_time: datetime.datetime, group_id: str, user_id: str) -> tuple[str, Union[int, str]]:
def morning_and_update(self, now_time: datetime.datetime, group_id: str, user_id: str) -> Tuple[str, Union[int, str]]:
# 起床并写数据
sleep_time = datetime.datetime.strptime(self.user_data[group_id][user_id]['sleep_time'], '%Y-%m-%d %H:%M:%S')
in_sleep = now_time - sleep_time
Expand Down Expand Up @@ -423,7 +423,7 @@ def judge_deep_sleep(self, group_id: str, user_id: str, now_time: datetime.datet
return False

# 进行晚安并更新数据
def night_and_update(self, now_time: datetime.datetime, group_id: str, user_id: str) -> tuple[str, Union[int, str]]:
def night_and_update(self, now_time: datetime.datetime, group_id: str, user_id: str) -> Tuple[str, Union[int, str]]:
# 若之前没有数据就直接创建一个
if user_id not in self.user_data[group_id].keys():
self.user_data[group_id][user_id] = {
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "nonebot-plugin-morning"
version = "0.2.0-alpha.1"
version = "0.2.0a2"
description = "Good morning & good night!"
authors = ["KafCoppelia <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 20cc422

Please sign in to comment.