ソースを参照

Detect DMs in get_chat_info() via RoomKind

The comparison was against the string "ROOM_KIND_DM" while _room_kinds
holds RoomKind enum members, so every chat was reported as "group".
Paul Klumpp 1 週間 前
コミット
c81fd71c59
1 ファイル変更2 行追加2 行削除
  1. 2 2
      adapter.py

+ 2 - 2
adapter.py

@@ -817,8 +817,8 @@ class ChattoAdapter(BasePlatformAdapter):
         BasePlatformAdapter override
         """
         name = self._room_names.get(chat_id, chat_id)
-        kind = self._room_kinds.get(chat_id, "")
-        chat_type = "dm" if kind == "ROOM_KIND_DM" else "group"
+        kind = self._room_kinds.get(chat_id)
+        chat_type = "dm" if kind == RoomKind.DM else "group"
         return {
             "name": name,
             "type": chat_type,