Skip to content

Commit 0dae9ed

Browse files
shuiping233KBVsent
authored andcommitted
refactor: downgrade StrEnum to (str, Enum) in kook_type for backward compatibility (AstrBotDevs#6512)
我那时候搓 AstrBotDevs#5719 的时候 AstrBotDevs#5729 已经合并了, 既然ruff的py限制版本里是`3.12`,那我那时候干脆用的StrEnum,现在发现那个pr revert了,那我也降级回旧Enum写法好了
1 parent 52cf291 commit 0dae9ed

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

astrbot/core/platform/sources/kook/kook_types.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import json
2-
from enum import IntEnum, StrEnum
2+
from enum import Enum, IntEnum
33
from typing import Annotated, Any, Literal
44

55
from pydantic import BaseModel, ConfigDict, Field, model_validator
@@ -36,7 +36,7 @@ class KookMessageType(IntEnum):
3636
SYSTEM = 255
3737

3838

39-
class KookModuleType(StrEnum):
39+
class KookModuleType(str, Enum):
4040
PLAIN_TEXT = "plain-text"
4141
KMARKDOWN = "kmarkdown"
4242
IMAGE = "image"
@@ -311,7 +311,7 @@ class KookMessageSignal(IntEnum):
311311
"""server->client resume ack"""
312312

313313

314-
class KookChannelType(StrEnum):
314+
class KookChannelType(str, Enum):
315315
GROUP = "GROUP"
316316
PERSON = "PERSON"
317317
BROADCAST = "BROADCAST"

0 commit comments

Comments
 (0)