nonebot-plugin-fishing2 0.1.1__py3-none-any.whl → 1.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nonebot_plugin_fishing2/__init__.py +601 -591
- nonebot_plugin_fishing2/config.py +301 -301
- nonebot_plugin_fishing2/data_source.py +920 -895
- nonebot_plugin_fishing2/fish_helper.py +157 -157
- nonebot_plugin_fishing2/migrations/7609e6d106dd_init_db.py +43 -43
- nonebot_plugin_fishing2/migrations/c5ab992c9af3_add_achievements.py +38 -38
- nonebot_plugin_fishing2/model.py +20 -20
- {nonebot_plugin_fishing2-0.1.1.dist-info → nonebot_plugin_fishing2-1.0.1.dist-info}/METADATA +8 -8
- nonebot_plugin_fishing2-1.0.1.dist-info/RECORD +14 -0
- {nonebot_plugin_fishing2-0.1.1.dist-info → nonebot_plugin_fishing2-1.0.1.dist-info}/WHEEL +1 -1
- {nonebot_plugin_fishing2-0.1.1.dist-info → nonebot_plugin_fishing2-1.0.1.dist-info/licenses}/LICENSE +21 -21
- nonebot_plugin_fishing2-0.1.1.dist-info/RECORD +0 -14
|
@@ -1,157 +1,157 @@
|
|
|
1
|
-
from typing import Literal, Optional, Union
|
|
2
|
-
|
|
3
|
-
from nonebot.adapters.onebot.v11 import MessageSegment
|
|
4
|
-
|
|
5
|
-
from .config import config
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class Achievement:
|
|
9
|
-
type: Literal["fishing_frequency", "fish_type"] = None
|
|
10
|
-
name: str = None
|
|
11
|
-
data: Union[str, int] = (None,)
|
|
12
|
-
description: int = None
|
|
13
|
-
|
|
14
|
-
def __init__(self, achievemrnt: dict):
|
|
15
|
-
self.type = achievemrnt["type"]
|
|
16
|
-
self.name = achievemrnt["name"]
|
|
17
|
-
self.data = achievemrnt["data"]
|
|
18
|
-
self.description = achievemrnt["description"]
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class Property:
|
|
22
|
-
type: Literal[
|
|
23
|
-
"rare_fish", "normal_fish", "fish", "rm_fish", "special_fish", "no_fish"
|
|
24
|
-
] = None
|
|
25
|
-
key: Optional[str] = None
|
|
26
|
-
value: Optional[int] = None
|
|
27
|
-
|
|
28
|
-
def __init__(self, property: dict):
|
|
29
|
-
self.type = property["type"]
|
|
30
|
-
self.key = property["key"] if property.get("key") else None
|
|
31
|
-
self.value = property["value"] if property.get("value") else None
|
|
32
|
-
|
|
33
|
-
# fmt:off
|
|
34
|
-
def __str__(self) -> str:
|
|
35
|
-
match self.type:
|
|
36
|
-
case "normal_fish":
|
|
37
|
-
result = f"普通鱼权重{'增加' if self.value > 0 else '减少'}{abs(self.value)}"
|
|
38
|
-
case "rare_fish":
|
|
39
|
-
result = f"稀有鱼权重{'增加' if self.value > 0 else '减少'}{abs(self.value)}"
|
|
40
|
-
case "fish":
|
|
41
|
-
result = f"{self.key}权重{'增加' if self.value > 0 else '减少'}{abs(self.value)}"
|
|
42
|
-
case "rm_fish":
|
|
43
|
-
result = f"不会钓到{self.key}\n"
|
|
44
|
-
case "special_fish":
|
|
45
|
-
result = f"特殊鱼概率{'增加' if self.value > 0 else '减少'}{abs(self.value)}"
|
|
46
|
-
case "no_fish":
|
|
47
|
-
result = f"空军概率{'增加' if self.value > 0 else '减少'}{abs(self.value)}"
|
|
48
|
-
case _:
|
|
49
|
-
pass
|
|
50
|
-
return result
|
|
51
|
-
# fmt:on
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
class Fish:
|
|
55
|
-
type: Literal["fish", "item"] = "fish"
|
|
56
|
-
name: str = ""
|
|
57
|
-
price: int = 0
|
|
58
|
-
props: list[Property] = []
|
|
59
|
-
description: str = ""
|
|
60
|
-
can_catch: bool = False
|
|
61
|
-
sleep_time: Optional[int] = 0
|
|
62
|
-
weight: Optional[int] = 0
|
|
63
|
-
can_buy: bool = False
|
|
64
|
-
buy_price: Optional[int] = 0
|
|
65
|
-
amount: Optional[int] = 0
|
|
66
|
-
can_sell: bool = False
|
|
67
|
-
|
|
68
|
-
def __init__(self, fish_dict: dict):
|
|
69
|
-
self.type = fish_dict["type"] if fish_dict.get("type") else "fish"
|
|
70
|
-
self.name = fish_dict["name"] # 鱼名字都不填,搁着虚空造鱼呢?
|
|
71
|
-
self.price = fish_dict["price"] if fish_dict.get("price") else 15
|
|
72
|
-
self.amount = fish_dict["amount"] if fish_dict.get("amount") else 1
|
|
73
|
-
self.description = (
|
|
74
|
-
fish_dict["description"]
|
|
75
|
-
if fish_dict.get("description")
|
|
76
|
-
else "没有人知道这条鱼的信息。"
|
|
77
|
-
)
|
|
78
|
-
self.can_catch = fish_dict["can_catch"]
|
|
79
|
-
self.can_buy = fish_dict["can_buy"]
|
|
80
|
-
self.can_sell = fish_dict["can_sell"]
|
|
81
|
-
|
|
82
|
-
self.sleep_time = fish_dict["sleep_time"] if fish_dict.get("sleep_time") else 60
|
|
83
|
-
self.weight = fish_dict["weight"] if fish_dict.get("weight") else 0
|
|
84
|
-
|
|
85
|
-
self.buy_price = (
|
|
86
|
-
fish_dict["buy_price"]
|
|
87
|
-
if fish_dict.get("buy_price")
|
|
88
|
-
else int(fish_dict["price"] * config.buy_rate)
|
|
89
|
-
)
|
|
90
|
-
|
|
91
|
-
self.props = []
|
|
92
|
-
if fish_dict.get("props") and fish_dict["props"] != []:
|
|
93
|
-
for property in fish_dict["props"]:
|
|
94
|
-
self.props.append(Property(property))
|
|
95
|
-
|
|
96
|
-
def print_info(self) -> list[MessageSegment]:
|
|
97
|
-
message = []
|
|
98
|
-
|
|
99
|
-
message1 = ""
|
|
100
|
-
message1 += f"▶ 名称:{self.name}\n"
|
|
101
|
-
message1 += f"▶ 基准价格:{self.price} {fishing_coin_name}\n"
|
|
102
|
-
message1 += f"▶ 单份数量:{self.amount}\n"
|
|
103
|
-
message1 += f"▶ 描述:{self.description}\n"
|
|
104
|
-
message1 += f'▶ {"可钓鱼获取" if self.can_catch else "不可钓鱼获取"},'
|
|
105
|
-
message1 += f'{"可购买" if self.can_buy else "不可购买"},'
|
|
106
|
-
message1 += f'{"可出售" if self.can_sell else "不可出售"}'
|
|
107
|
-
message.append(MessageSegment.text(message1))
|
|
108
|
-
if self.can_catch:
|
|
109
|
-
message2 = ""
|
|
110
|
-
message2 += f"▶ 钓鱼信息:\n"
|
|
111
|
-
message2 += f" ▷ 基础权重:{self.weight},"
|
|
112
|
-
message2 += f"上钩时间:{self.sleep_time}s"
|
|
113
|
-
message.append(MessageSegment.text(message2))
|
|
114
|
-
if self.can_buy:
|
|
115
|
-
message3 = ""
|
|
116
|
-
message3 += f"▶ 商店信息:\n"
|
|
117
|
-
message3 += f" ▷ 购买价格:{self.buy_price}\n"
|
|
118
|
-
message.append(MessageSegment.text(message3))
|
|
119
|
-
if self.props != []:
|
|
120
|
-
message4 = ""
|
|
121
|
-
message4 += f"▶ 道具信息:\n"
|
|
122
|
-
message4 += f' ▷ 道具类型:{"鱼饵" if self.type == "fish" else "道具"}\n'
|
|
123
|
-
message4 += self.print_props()
|
|
124
|
-
message.append(MessageSegment.text(message4))
|
|
125
|
-
return message
|
|
126
|
-
|
|
127
|
-
def print_props(self) -> str:
|
|
128
|
-
result = " ▷ 道具效果:\n"
|
|
129
|
-
for i in range(len(self.props)):
|
|
130
|
-
prop = self.props[i]
|
|
131
|
-
result += (
|
|
132
|
-
f" {i + 1}. {str(prop)}"
|
|
133
|
-
if i == len(self.props) - 1
|
|
134
|
-
else f" {i + 1}. {str(prop)}\n"
|
|
135
|
-
)
|
|
136
|
-
return result
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
# Constants
|
|
140
|
-
fishing_coin_name = config.fishing_coin_name
|
|
141
|
-
config_fishes: list[Fish] = [Fish(fish_dict) for fish_dict in config.fishes]
|
|
142
|
-
config_achievements = [
|
|
143
|
-
Achievement(achievement_dict) for achievement_dict in config.fishing_achievement
|
|
144
|
-
]
|
|
145
|
-
|
|
146
|
-
fish_list: list[str] = [fish.name for fish in config_fishes]
|
|
147
|
-
can_catch_fishes = {fish.name: fish.weight for fish in config_fishes if fish.can_catch}
|
|
148
|
-
can_buy_fishes = [fish.name for fish in config_fishes if fish.can_buy]
|
|
149
|
-
can_sell_fishes = [fish.name for fish in config_fishes if fish.can_sell]
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
def get_fish_by_name(fish_name: str) -> Fish | None:
|
|
153
|
-
for fish in config_fishes:
|
|
154
|
-
if fish.name == fish_name:
|
|
155
|
-
return fish
|
|
156
|
-
|
|
157
|
-
return None
|
|
1
|
+
from typing import Literal, Optional, Union
|
|
2
|
+
|
|
3
|
+
from nonebot.adapters.onebot.v11 import MessageSegment
|
|
4
|
+
|
|
5
|
+
from .config import config
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Achievement:
|
|
9
|
+
type: Literal["fishing_frequency", "fish_type"] = None
|
|
10
|
+
name: str = None
|
|
11
|
+
data: Union[str, int] = (None,)
|
|
12
|
+
description: int = None
|
|
13
|
+
|
|
14
|
+
def __init__(self, achievemrnt: dict):
|
|
15
|
+
self.type = achievemrnt["type"]
|
|
16
|
+
self.name = achievemrnt["name"]
|
|
17
|
+
self.data = achievemrnt["data"]
|
|
18
|
+
self.description = achievemrnt["description"]
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class Property:
|
|
22
|
+
type: Literal[
|
|
23
|
+
"rare_fish", "normal_fish", "fish", "rm_fish", "special_fish", "no_fish"
|
|
24
|
+
] = None
|
|
25
|
+
key: Optional[str] = None
|
|
26
|
+
value: Optional[int] = None
|
|
27
|
+
|
|
28
|
+
def __init__(self, property: dict):
|
|
29
|
+
self.type = property["type"]
|
|
30
|
+
self.key = property["key"] if property.get("key") else None
|
|
31
|
+
self.value = property["value"] if property.get("value") else None
|
|
32
|
+
|
|
33
|
+
# fmt:off
|
|
34
|
+
def __str__(self) -> str:
|
|
35
|
+
match self.type:
|
|
36
|
+
case "normal_fish":
|
|
37
|
+
result = f"普通鱼权重{'增加' if self.value > 0 else '减少'}{abs(self.value)}"
|
|
38
|
+
case "rare_fish":
|
|
39
|
+
result = f"稀有鱼权重{'增加' if self.value > 0 else '减少'}{abs(self.value)}"
|
|
40
|
+
case "fish":
|
|
41
|
+
result = f"{self.key}权重{'增加' if self.value > 0 else '减少'}{abs(self.value)}"
|
|
42
|
+
case "rm_fish":
|
|
43
|
+
result = f"不会钓到{self.key}\n"
|
|
44
|
+
case "special_fish":
|
|
45
|
+
result = f"特殊鱼概率{'增加' if self.value > 0 else '减少'}{abs(self.value)}"
|
|
46
|
+
case "no_fish":
|
|
47
|
+
result = f"空军概率{'增加' if self.value > 0 else '减少'}{abs(self.value)}"
|
|
48
|
+
case _:
|
|
49
|
+
pass
|
|
50
|
+
return result
|
|
51
|
+
# fmt:on
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class Fish:
|
|
55
|
+
type: Literal["fish", "item"] = "fish"
|
|
56
|
+
name: str = ""
|
|
57
|
+
price: int = 0
|
|
58
|
+
props: list[Property] = []
|
|
59
|
+
description: str = ""
|
|
60
|
+
can_catch: bool = False
|
|
61
|
+
sleep_time: Optional[int] = 0
|
|
62
|
+
weight: Optional[int] = 0
|
|
63
|
+
can_buy: bool = False
|
|
64
|
+
buy_price: Optional[int] = 0
|
|
65
|
+
amount: Optional[int] = 0
|
|
66
|
+
can_sell: bool = False
|
|
67
|
+
|
|
68
|
+
def __init__(self, fish_dict: dict):
|
|
69
|
+
self.type = fish_dict["type"] if fish_dict.get("type") else "fish"
|
|
70
|
+
self.name = fish_dict["name"] # 鱼名字都不填,搁着虚空造鱼呢?
|
|
71
|
+
self.price = fish_dict["price"] if fish_dict.get("price") else 15
|
|
72
|
+
self.amount = fish_dict["amount"] if fish_dict.get("amount") else 1
|
|
73
|
+
self.description = (
|
|
74
|
+
fish_dict["description"]
|
|
75
|
+
if fish_dict.get("description")
|
|
76
|
+
else "没有人知道这条鱼的信息。"
|
|
77
|
+
)
|
|
78
|
+
self.can_catch = fish_dict["can_catch"]
|
|
79
|
+
self.can_buy = fish_dict["can_buy"]
|
|
80
|
+
self.can_sell = fish_dict["can_sell"]
|
|
81
|
+
|
|
82
|
+
self.sleep_time = fish_dict["sleep_time"] if fish_dict.get("sleep_time") else 60
|
|
83
|
+
self.weight = fish_dict["weight"] if fish_dict.get("weight") else 0
|
|
84
|
+
|
|
85
|
+
self.buy_price = (
|
|
86
|
+
fish_dict["buy_price"]
|
|
87
|
+
if fish_dict.get("buy_price")
|
|
88
|
+
else int(fish_dict["price"] * config.buy_rate)
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
self.props = []
|
|
92
|
+
if fish_dict.get("props") and fish_dict["props"] != []:
|
|
93
|
+
for property in fish_dict["props"]:
|
|
94
|
+
self.props.append(Property(property))
|
|
95
|
+
|
|
96
|
+
def print_info(self) -> list[MessageSegment]:
|
|
97
|
+
message = []
|
|
98
|
+
|
|
99
|
+
message1 = ""
|
|
100
|
+
message1 += f"▶ 名称:{self.name}\n"
|
|
101
|
+
message1 += f"▶ 基准价格:{self.price} {fishing_coin_name}\n"
|
|
102
|
+
message1 += f"▶ 单份数量:{self.amount}\n"
|
|
103
|
+
message1 += f"▶ 描述:{self.description}\n"
|
|
104
|
+
message1 += f'▶ {"可钓鱼获取" if self.can_catch else "不可钓鱼获取"},'
|
|
105
|
+
message1 += f'{"可购买" if self.can_buy else "不可购买"},'
|
|
106
|
+
message1 += f'{"可出售" if self.can_sell else "不可出售"}'
|
|
107
|
+
message.append(MessageSegment.text(message1))
|
|
108
|
+
if self.can_catch:
|
|
109
|
+
message2 = ""
|
|
110
|
+
message2 += f"▶ 钓鱼信息:\n"
|
|
111
|
+
message2 += f" ▷ 基础权重:{self.weight},"
|
|
112
|
+
message2 += f"上钩时间:{self.sleep_time}s"
|
|
113
|
+
message.append(MessageSegment.text(message2))
|
|
114
|
+
if self.can_buy:
|
|
115
|
+
message3 = ""
|
|
116
|
+
message3 += f"▶ 商店信息:\n"
|
|
117
|
+
message3 += f" ▷ 购买价格:{self.buy_price}\n"
|
|
118
|
+
message.append(MessageSegment.text(message3))
|
|
119
|
+
if self.props != []:
|
|
120
|
+
message4 = ""
|
|
121
|
+
message4 += f"▶ 道具信息:\n"
|
|
122
|
+
message4 += f' ▷ 道具类型:{"鱼饵" if self.type == "fish" else "道具"}\n'
|
|
123
|
+
message4 += self.print_props()
|
|
124
|
+
message.append(MessageSegment.text(message4))
|
|
125
|
+
return message
|
|
126
|
+
|
|
127
|
+
def print_props(self) -> str:
|
|
128
|
+
result = " ▷ 道具效果:\n"
|
|
129
|
+
for i in range(len(self.props)):
|
|
130
|
+
prop = self.props[i]
|
|
131
|
+
result += (
|
|
132
|
+
f" {i + 1}. {str(prop)}"
|
|
133
|
+
if i == len(self.props) - 1
|
|
134
|
+
else f" {i + 1}. {str(prop)}\n"
|
|
135
|
+
)
|
|
136
|
+
return result
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
# Constants
|
|
140
|
+
fishing_coin_name = config.fishing_coin_name
|
|
141
|
+
config_fishes: list[Fish] = [Fish(fish_dict) for fish_dict in config.fishes]
|
|
142
|
+
config_achievements = [
|
|
143
|
+
Achievement(achievement_dict) for achievement_dict in config.fishing_achievement
|
|
144
|
+
]
|
|
145
|
+
|
|
146
|
+
fish_list: list[str] = [fish.name for fish in config_fishes]
|
|
147
|
+
can_catch_fishes = {fish.name: fish.weight for fish in config_fishes if fish.can_catch}
|
|
148
|
+
can_buy_fishes = [fish.name for fish in config_fishes if fish.can_buy]
|
|
149
|
+
can_sell_fishes = [fish.name for fish in config_fishes if fish.can_sell]
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
def get_fish_by_name(fish_name: str) -> Fish | None:
|
|
153
|
+
for fish in config_fishes:
|
|
154
|
+
if fish.name == fish_name:
|
|
155
|
+
return fish
|
|
156
|
+
|
|
157
|
+
return None
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
"""init db
|
|
2
|
-
|
|
3
|
-
迁移 ID: 7609e6d106dd
|
|
4
|
-
父迁移:
|
|
5
|
-
创建时间: 2024-04-05 19:08:58.835014
|
|
6
|
-
|
|
7
|
-
"""
|
|
8
|
-
from __future__ import annotations
|
|
9
|
-
|
|
10
|
-
from collections.abc import Sequence
|
|
11
|
-
|
|
12
|
-
from alembic import op
|
|
13
|
-
import sqlalchemy as sa
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
revision: str = '7609e6d106dd'
|
|
17
|
-
down_revision: str | Sequence[str] | None = None
|
|
18
|
-
branch_labels: str | Sequence[str] | None = ('nonebot_plugin_fishing',)
|
|
19
|
-
depends_on: str | Sequence[str] | None = None
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
def upgrade(name: str = "") -> None:
|
|
23
|
-
if name:
|
|
24
|
-
return
|
|
25
|
-
# ### commands auto generated by Alembic - please adjust! ###
|
|
26
|
-
op.create_table('nonebot_plugin_fishing_fishingrecord',
|
|
27
|
-
sa.Column('id', sa.Integer(), nullable=False),
|
|
28
|
-
sa.Column('user_id', sa.String(length=32), nullable=False),
|
|
29
|
-
sa.Column('time', sa.Integer(), nullable=False),
|
|
30
|
-
sa.Column('frequency', sa.Integer(), nullable=False),
|
|
31
|
-
sa.Column('fishes', sa.TEXT(), nullable=False),
|
|
32
|
-
sa.Column('coin', sa.Integer(), nullable=False),
|
|
33
|
-
sa.PrimaryKeyConstraint('id', name=op.f('pk_nonebot_plugin_fishing_fishingrecord')),
|
|
34
|
-
info={'bind_key': 'nonebot_plugin_fishing'}
|
|
35
|
-
)
|
|
36
|
-
# ### end Alembic commands ###
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
def downgrade(name: str = "") -> None:
|
|
40
|
-
if name:
|
|
41
|
-
return
|
|
42
|
-
# ### commands auto generated by Alembic - please adjust! ###
|
|
43
|
-
op.drop_table('nonebot_plugin_fishing_fishingrecord')
|
|
1
|
+
"""init db
|
|
2
|
+
|
|
3
|
+
迁移 ID: 7609e6d106dd
|
|
4
|
+
父迁移:
|
|
5
|
+
创建时间: 2024-04-05 19:08:58.835014
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from collections.abc import Sequence
|
|
11
|
+
|
|
12
|
+
from alembic import op
|
|
13
|
+
import sqlalchemy as sa
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
revision: str = '7609e6d106dd'
|
|
17
|
+
down_revision: str | Sequence[str] | None = None
|
|
18
|
+
branch_labels: str | Sequence[str] | None = ('nonebot_plugin_fishing',)
|
|
19
|
+
depends_on: str | Sequence[str] | None = None
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def upgrade(name: str = "") -> None:
|
|
23
|
+
if name:
|
|
24
|
+
return
|
|
25
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
26
|
+
op.create_table('nonebot_plugin_fishing_fishingrecord',
|
|
27
|
+
sa.Column('id', sa.Integer(), nullable=False),
|
|
28
|
+
sa.Column('user_id', sa.String(length=32), nullable=False),
|
|
29
|
+
sa.Column('time', sa.Integer(), nullable=False),
|
|
30
|
+
sa.Column('frequency', sa.Integer(), nullable=False),
|
|
31
|
+
sa.Column('fishes', sa.TEXT(), nullable=False),
|
|
32
|
+
sa.Column('coin', sa.Integer(), nullable=False),
|
|
33
|
+
sa.PrimaryKeyConstraint('id', name=op.f('pk_nonebot_plugin_fishing_fishingrecord')),
|
|
34
|
+
info={'bind_key': 'nonebot_plugin_fishing'}
|
|
35
|
+
)
|
|
36
|
+
# ### end Alembic commands ###
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def downgrade(name: str = "") -> None:
|
|
40
|
+
if name:
|
|
41
|
+
return
|
|
42
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
43
|
+
op.drop_table('nonebot_plugin_fishing_fishingrecord')
|
|
44
44
|
# ### end Alembic commands ###
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
"""add achievements
|
|
2
|
-
|
|
3
|
-
迁移 ID: c5ab992c9af3
|
|
4
|
-
父迁移: e9015df43907
|
|
5
|
-
创建时间: 2024-09-22 16:44:24.934270
|
|
6
|
-
|
|
7
|
-
"""
|
|
8
|
-
from __future__ import annotations
|
|
9
|
-
|
|
10
|
-
from collections.abc import Sequence
|
|
11
|
-
|
|
12
|
-
from alembic import op
|
|
13
|
-
import sqlalchemy as sa
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
revision: str = 'c5ab992c9af3'
|
|
17
|
-
down_revision: str | Sequence[str] | None = 'e9015df43907'
|
|
18
|
-
branch_labels: str | Sequence[str] | None = None
|
|
19
|
-
depends_on: str | Sequence[str] | None = None
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
def upgrade(name: str = "") -> None:
|
|
23
|
-
if name:
|
|
24
|
-
return
|
|
25
|
-
# ### commands auto generated by Alembic - please adjust! ###
|
|
26
|
-
with op.batch_alter_table('nonebot_plugin_fishing_fishingrecord', schema=None) as batch_op:
|
|
27
|
-
batch_op.add_column(sa.Column('achievements', sa.TEXT(), nullable=False))
|
|
28
|
-
|
|
29
|
-
# ### end Alembic commands ###
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
def downgrade(name: str = "") -> None:
|
|
33
|
-
if name:
|
|
34
|
-
return
|
|
35
|
-
# ### commands auto generated by Alembic - please adjust! ###
|
|
36
|
-
with op.batch_alter_table('nonebot_plugin_fishing_fishingrecord', schema=None) as batch_op:
|
|
37
|
-
batch_op.drop_column('achievements')
|
|
38
|
-
|
|
1
|
+
"""add achievements
|
|
2
|
+
|
|
3
|
+
迁移 ID: c5ab992c9af3
|
|
4
|
+
父迁移: e9015df43907
|
|
5
|
+
创建时间: 2024-09-22 16:44:24.934270
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from collections.abc import Sequence
|
|
11
|
+
|
|
12
|
+
from alembic import op
|
|
13
|
+
import sqlalchemy as sa
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
revision: str = 'c5ab992c9af3'
|
|
17
|
+
down_revision: str | Sequence[str] | None = 'e9015df43907'
|
|
18
|
+
branch_labels: str | Sequence[str] | None = None
|
|
19
|
+
depends_on: str | Sequence[str] | None = None
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def upgrade(name: str = "") -> None:
|
|
23
|
+
if name:
|
|
24
|
+
return
|
|
25
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
26
|
+
with op.batch_alter_table('nonebot_plugin_fishing_fishingrecord', schema=None) as batch_op:
|
|
27
|
+
batch_op.add_column(sa.Column('achievements', sa.TEXT(), nullable=False))
|
|
28
|
+
|
|
29
|
+
# ### end Alembic commands ###
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def downgrade(name: str = "") -> None:
|
|
33
|
+
if name:
|
|
34
|
+
return
|
|
35
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
36
|
+
with op.batch_alter_table('nonebot_plugin_fishing_fishingrecord', schema=None) as batch_op:
|
|
37
|
+
batch_op.drop_column('achievements')
|
|
38
|
+
|
|
39
39
|
# ### end Alembic commands ###
|
nonebot_plugin_fishing2/model.py
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
from nonebot_plugin_orm import Model
|
|
2
|
-
from sqlalchemy import String, TEXT
|
|
3
|
-
from sqlalchemy.orm import Mapped, mapped_column
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class FishingRecord(Model):
|
|
7
|
-
id: Mapped[int] = mapped_column(primary_key=True)
|
|
8
|
-
user_id: Mapped[str] = mapped_column(String(32))
|
|
9
|
-
time: Mapped[int]
|
|
10
|
-
frequency: Mapped[int]
|
|
11
|
-
fishes: Mapped[str] = mapped_column(TEXT)
|
|
12
|
-
special_fishes: Mapped[str] = mapped_column(TEXT, default="{}")
|
|
13
|
-
coin: Mapped[int] = mapped_column(default=0)
|
|
14
|
-
achievements: Mapped[str] = mapped_column(TEXT, default="[]")
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class SpecialFishes(Model):
|
|
18
|
-
id: Mapped[int] = mapped_column(primary_key=True)
|
|
19
|
-
user_id: Mapped[str] = mapped_column(String(32))
|
|
20
|
-
fish: Mapped[str] = mapped_column(TEXT, default="{}")
|
|
1
|
+
from nonebot_plugin_orm import Model
|
|
2
|
+
from sqlalchemy import String, TEXT
|
|
3
|
+
from sqlalchemy.orm import Mapped, mapped_column
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class FishingRecord(Model):
|
|
7
|
+
id: Mapped[int] = mapped_column(primary_key=True)
|
|
8
|
+
user_id: Mapped[str] = mapped_column(String(32))
|
|
9
|
+
time: Mapped[int]
|
|
10
|
+
frequency: Mapped[int]
|
|
11
|
+
fishes: Mapped[str] = mapped_column(TEXT)
|
|
12
|
+
special_fishes: Mapped[str] = mapped_column(TEXT, default="{}")
|
|
13
|
+
coin: Mapped[int] = mapped_column(default=0)
|
|
14
|
+
achievements: Mapped[str] = mapped_column(TEXT, default="[]")
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class SpecialFishes(Model):
|
|
18
|
+
id: Mapped[int] = mapped_column(primary_key=True)
|
|
19
|
+
user_id: Mapped[str] = mapped_column(String(32))
|
|
20
|
+
fish: Mapped[str] = mapped_column(TEXT, default="{}")
|
{nonebot_plugin_fishing2-0.1.1.dist-info → nonebot_plugin_fishing2-1.0.1.dist-info}/METADATA
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: nonebot-plugin-fishing2
|
|
3
|
-
Version: 0.1
|
|
3
|
+
Version: 1.0.1
|
|
4
4
|
Summary: 更好的电子钓鱼
|
|
5
|
-
License: MIT
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
License-File: LICENSE
|
|
6
7
|
Keywords: fishing
|
|
7
|
-
Author:
|
|
8
|
-
Author-email:
|
|
8
|
+
Author: Polaris_Light
|
|
9
|
+
Author-email: 995905922@qq.com
|
|
9
10
|
Requires-Python: >=3.8
|
|
10
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.8
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.9
|
|
@@ -15,6 +15,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.11
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.12
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
18
19
|
Requires-Dist: nonebot-adapter-onebot (>=2.0.0-beta.1)
|
|
19
20
|
Requires-Dist: nonebot-plugin-localstore (>=0.6.0)
|
|
20
21
|
Requires-Dist: nonebot-plugin-orm (>=0.7.1)
|
|
@@ -33,7 +34,7 @@ Description-Content-Type: text/markdown
|
|
|
33
34
|
_✨ 更好的电子钓鱼 ✨_
|
|
34
35
|
|
|
35
36
|
<a href="./LICENSE">
|
|
36
|
-
<img src="https://img.shields.io/github/license/
|
|
37
|
+
<img src="https://img.shields.io/github/license/GLDYM/nonebot-plugin-fishing2.svg" alt="license">
|
|
37
38
|
</a>
|
|
38
39
|
<a href="https://pypi.python.org/pypi/nonebot-plugin-fishing2">
|
|
39
40
|
<img src="https://img.shields.io/pypi/v/nonebot-plugin-fishing2.svg" alt="pypi">
|
|
@@ -161,5 +162,4 @@ FISHES='
|
|
|
161
162
|
- [x] 买装备!
|
|
162
163
|
- [x] 支持卖与普通鱼同名的特殊鱼
|
|
163
164
|
- [x] 管理员命令:捞鱼
|
|
164
|
-
- [ ] 屏蔽词库
|
|
165
165
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
nonebot_plugin_fishing2/__init__.py,sha256=68Neo_9sWDjGxv-s_Bl_JQp8NRfGHM9f46f1cQfrlvE,19976
|
|
2
|
+
nonebot_plugin_fishing2/config.py,sha256=5tMkNQ-gQB5L7Qnf4G6U1gopmvVRx5xeU_v5eOELFbA,9450
|
|
3
|
+
nonebot_plugin_fishing2/data_source.py,sha256=X3WVx0CKrV_0x8EiraUE5d8NjP7TmwfqcYqX4u5-l6Y,34647
|
|
4
|
+
nonebot_plugin_fishing2/fish_helper.py,sha256=BD1Oz3fRD1PRVjISyKPKzeBMYmMEiPZfVfdL3txMnE8,5897
|
|
5
|
+
nonebot_plugin_fishing2/migrations/68463f3e5f33_.py,sha256=WnaV5T1uCHvYWcnepHqV9kOurDYddFUvXXfA2Rtd5Ok,776
|
|
6
|
+
nonebot_plugin_fishing2/migrations/7609e6d106dd_init_db.py,sha256=Mfn_K3nEP1ahNIubpuzgmLuY6Mj0W9phelIXj2sy3nI,1343
|
|
7
|
+
nonebot_plugin_fishing2/migrations/c5ab992c9af3_add_achievements.py,sha256=NqXmdqvadVjO83GWoMGm7NZrWd4d3Le2CkaW-i8V8Tg,1081
|
|
8
|
+
nonebot_plugin_fishing2/migrations/e9015df43907_add_special_fishes_field.py,sha256=R4p9vPD5lgg4vmY2KUgF2qIlraxhPYkL93lM5l7wMZw,1094
|
|
9
|
+
nonebot_plugin_fishing2/migrations/f70bdeaec7a4_add_specialfishes_table.py,sha256=DUqv9MTaOSZCBj_9oT2eY3pmWeMnyH0cPj9GyYa5Sag,1194
|
|
10
|
+
nonebot_plugin_fishing2/model.py,sha256=rpITGkHUyFcu8h1kRvH4teaNYMdoN_S-c15oDKnjTA8,732
|
|
11
|
+
nonebot_plugin_fishing2-1.0.1.dist-info/METADATA,sha256=toBXdhGj4y9YSUHs_fMrkDEf_74WE1T-ZTw1PP9LWPo,7344
|
|
12
|
+
nonebot_plugin_fishing2-1.0.1.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
13
|
+
nonebot_plugin_fishing2-1.0.1.dist-info/licenses/LICENSE,sha256=ZSzAMQlEYzI_Hj8fBfSxjpt4tQzD0C4Q7zIFmEP-Qqk,1070
|
|
14
|
+
nonebot_plugin_fishing2-1.0.1.dist-info/RECORD,,
|
{nonebot_plugin_fishing2-0.1.1.dist-info → nonebot_plugin_fishing2-1.0.1.dist-info/licenses}/LICENSE
RENAMED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Polaris_Light
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Polaris_Light
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
nonebot_plugin_fishing2/__init__.py,sha256=P-rLNXG2ZmdfzU7UXSwWrnh4jT8OI2fsm3LPy6COrh8,20200
|
|
2
|
-
nonebot_plugin_fishing2/config.py,sha256=xYDdq9Rwce8vfg-M91lUd2TfZDQnToHlI77GdpLFp-U,9751
|
|
3
|
-
nonebot_plugin_fishing2/data_source.py,sha256=fbIWF4nJ1GVQ17UCue_RcEPxi_2oRmByhkveAXI_6oU,34488
|
|
4
|
-
nonebot_plugin_fishing2/fish_helper.py,sha256=Rf3SX4UcM0-E6apLUbHB40I4onK-8qPZmZrsVBMnZ3I,6054
|
|
5
|
-
nonebot_plugin_fishing2/migrations/68463f3e5f33_.py,sha256=WnaV5T1uCHvYWcnepHqV9kOurDYddFUvXXfA2Rtd5Ok,776
|
|
6
|
-
nonebot_plugin_fishing2/migrations/7609e6d106dd_init_db.py,sha256=tpuIfsS6yPsnGIeMPo16exsEfYZ_urgYAqlCyQ8aw-Y,1386
|
|
7
|
-
nonebot_plugin_fishing2/migrations/c5ab992c9af3_add_achievements.py,sha256=KVj9ADeP03zfW4ZBDmnghbWdxLor3u1yKeho0GaddCI,1119
|
|
8
|
-
nonebot_plugin_fishing2/migrations/e9015df43907_add_special_fishes_field.py,sha256=R4p9vPD5lgg4vmY2KUgF2qIlraxhPYkL93lM5l7wMZw,1094
|
|
9
|
-
nonebot_plugin_fishing2/migrations/f70bdeaec7a4_add_specialfishes_table.py,sha256=DUqv9MTaOSZCBj_9oT2eY3pmWeMnyH0cPj9GyYa5Sag,1194
|
|
10
|
-
nonebot_plugin_fishing2/model.py,sha256=_DtmxiQhJDiIvY1XOMQZ0HA-ruWY0bexWX9frdhnk0Q,752
|
|
11
|
-
nonebot_plugin_fishing2-0.1.1.dist-info/LICENSE,sha256=n-2xoOXX434-tBisMKX2-_FycV2VrmIiTP1rZvuW_fY,1091
|
|
12
|
-
nonebot_plugin_fishing2-0.1.1.dist-info/METADATA,sha256=-sV5ctEfIgmreAt6aDgmEPA6GRUeskeBk4XEpeV2JQ4,7355
|
|
13
|
-
nonebot_plugin_fishing2-0.1.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
14
|
-
nonebot_plugin_fishing2-0.1.1.dist-info/RECORD,,
|