Spaces:
Paused
Paused
iamgojoof6eyes
commited on
Commit
·
8c470f8
1
Parent(s):
1b80a3b
Minor updates in chat_type
Browse files- Powers/utils/chat_type.py +14 -14
Powers/utils/chat_type.py
CHANGED
|
@@ -7,28 +7,28 @@ from pyrogram.types import Message
|
|
| 7 |
|
| 8 |
async def chattype(m: Message):
|
| 9 |
# To get chat type with message
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
if bool(m.chat and m.chat.type in {ChatType.PRIVATE}):
|
| 15 |
-
ct = "private"
|
| 16 |
|
| 17 |
-
|
| 18 |
-
|
| 19 |
|
| 20 |
-
|
| 21 |
-
|
| 22 |
|
| 23 |
-
if bool(m.chat and m.chat.type in {ChatType.BOT}):
|
| 24 |
-
ct ="bot"
|
| 25 |
|
| 26 |
-
|
| 27 |
-
return ct
|
| 28 |
|
| 29 |
async def c_type(chat_id):
|
| 30 |
# To get chat type with chat id
|
| 31 |
-
|
| 32 |
c = Gojo.get_chat(chat_id)
|
| 33 |
|
| 34 |
if c.type == ChatType.BOT:
|
|
|
|
| 7 |
|
| 8 |
async def chattype(m: Message):
|
| 9 |
# To get chat type with message
|
| 10 |
+
if m.chat:
|
| 11 |
+
if m.chat.type == ChatType.CHANNEL:
|
| 12 |
+
ct = "channel"
|
| 13 |
+
|
| 14 |
+
if m.chat.type == ChatType.PRIVATE:
|
| 15 |
+
ct = "private"
|
| 16 |
|
| 17 |
+
if m.chat.type == ChatType.GROUP:
|
| 18 |
+
ct="group"
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
+
if m.chat.type == ChatType.SUPERGROUP:
|
| 21 |
+
ct = "supergroup"
|
| 22 |
|
| 23 |
+
if m.chat.type in ChatType.BOT:
|
| 24 |
+
ct ="bot"
|
| 25 |
|
|
|
|
|
|
|
| 26 |
|
| 27 |
+
return ct
|
|
|
|
| 28 |
|
| 29 |
async def c_type(chat_id):
|
| 30 |
# To get chat type with chat id
|
| 31 |
+
|
| 32 |
c = Gojo.get_chat(chat_id)
|
| 33 |
|
| 34 |
if c.type == ChatType.BOT:
|