iamgojoof6eyes commited on
Commit
cd83bdd
·
1 Parent(s): 7ffcf4d

Minor updates in chat_type

Browse files
Files changed (1) hide show
  1. 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
- if bool(m.chat and m.chat.type in {ChatType.CHANNEL}):
12
- ct = "channel"
13
-
14
- if bool(m.chat and m.chat.type in {ChatType.PRIVATE}):
15
- ct = "private"
16
 
17
- if bool(m.chat and m.chat.type in {ChatType.GROUP}):
18
- ct="group"
19
 
20
- if bool(m.chat and m.chat.type in {ChatType.SUPERGROUP}):
21
- ct = "supergroup"
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: