Skip to content

Commit c7bd57b

Browse files
committed
add enum value for thread chat type
1 parent 45f072b commit c7bd57b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pybotx/models/enums.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class AutoName(Enum):
66
def _generate_next_value_( # type: ignore
7-
name, # noqa: N805 (copied from official python docs)
7+
name,
88
start,
99
count,
1010
last_values,
@@ -59,6 +59,7 @@ class ChatTypes(AutoName):
5959
PERSONAL_CHAT = auto()
6060
GROUP_CHAT = auto()
6161
CHANNEL = auto()
62+
THREAD = auto()
6263

6364

6465
class SyncSourceTypes(AutoName):
@@ -92,6 +93,7 @@ class APIChatTypes(Enum):
9293
CHAT = "chat"
9394
GROUP_CHAT = "group_chat"
9495
CHANNEL = "channel"
96+
THREAD = "thread"
9597

9698

9799
class BotAPICommandTypes(StrEnum):
@@ -295,6 +297,7 @@ def convert_chat_type_from_domain(chat_type: ChatTypes) -> APIChatTypes:
295297
ChatTypes.PERSONAL_CHAT: APIChatTypes.CHAT,
296298
ChatTypes.GROUP_CHAT: APIChatTypes.GROUP_CHAT,
297299
ChatTypes.CHANNEL: APIChatTypes.CHANNEL,
300+
ChatTypes.THREAD: APIChatTypes.THREAD,
298301
}
299302

300303
converted_type = chat_types_mapping.get(chat_type)
@@ -323,6 +326,7 @@ def convert_chat_type_to_domain(
323326
APIChatTypes.CHAT: ChatTypes.PERSONAL_CHAT,
324327
APIChatTypes.GROUP_CHAT: ChatTypes.GROUP_CHAT,
325328
APIChatTypes.CHANNEL: ChatTypes.CHANNEL,
329+
APIChatTypes.THREAD: ChatTypes.THREAD,
326330
}
327331

328332
converted_type: Optional[IncomingChatTypes]

0 commit comments

Comments
 (0)