Spaces:
Sleeping
Sleeping
Captain Ezio
commited on
Commit
·
0b185f4
1
Parent(s):
7d22f56
Update chat_type.py
Browse files
Powers/utils/chat_type.py
CHANGED
@@ -24,18 +24,18 @@ async def chattype(m: Message):
|
|
24 |
async def c_type(c: Gojo, chat_id):
|
25 |
# To get chat type with chat id
|
26 |
|
27 |
-
|
28 |
|
29 |
-
if
|
30 |
ct = "channel"
|
31 |
|
32 |
-
if
|
33 |
ct = "group"
|
34 |
|
35 |
-
if
|
36 |
ct = "supergroup"
|
37 |
|
38 |
-
if
|
39 |
ct = "private"
|
40 |
|
41 |
return ct
|
|
|
24 |
async def c_type(c: Gojo, chat_id):
|
25 |
# To get chat type with chat id
|
26 |
|
27 |
+
ch = await c.get_chat(chat_id)
|
28 |
|
29 |
+
if ch.type == ChatType.CHANNEL:
|
30 |
ct = "channel"
|
31 |
|
32 |
+
if ch.type == ChatType.GROUP:
|
33 |
ct = "group"
|
34 |
|
35 |
+
if ch.type == ChatType.SUPERGROUP:
|
36 |
ct = "supergroup"
|
37 |
|
38 |
+
if ch.type == ChatType.PRIVATE:
|
39 |
ct = "private"
|
40 |
|
41 |
return ct
|