Captain Ezio commited on
Commit
7044b8b
·
1 Parent(s): a68f766

Update info.py

Browse files
Files changed (1) hide show
  1. Powers/plugins/info.py +6 -2
Powers/plugins/info.py CHANGED
@@ -237,6 +237,9 @@ async def chat_info(c: Gojo, chat, already=False):
237
 
238
  @Gojo.on_message(command(["info", "whois"]))
239
  async def info_func(c: Gojo, message: Message):
 
 
 
240
  user, _, user_name = await extract_user(c, message)
241
 
242
  if not user:
@@ -290,8 +293,9 @@ async def chat_info_func(c: Gojo, message: Message):
290
  splited = message.text.split()
291
  if len(splited) == 1:
292
  if message.reply_to_message and message.reply_to_message.sender_chat:
293
- chat = m.reply_to_message.sender_chat.id
294
- chat = message.chat.id
 
295
 
296
  else:
297
  chat = splited[1]
 
237
 
238
  @Gojo.on_message(command(["info", "whois"]))
239
  async def info_func(c: Gojo, message: Message):
240
+ if message.reply_to_message and message.reply_to_message.sender_chat:
241
+ await message.reply_text("This is not a user, but rather a channel. Use `/chinfo` to fetch its information.")
242
+ return
243
  user, _, user_name = await extract_user(c, message)
244
 
245
  if not user:
 
293
  splited = message.text.split()
294
  if len(splited) == 1:
295
  if message.reply_to_message and message.reply_to_message.sender_chat:
296
+ chat = message.reply_to_message.sender_chat.id
297
+ else:
298
+ chat = message.chat.id
299
 
300
  else:
301
  chat = splited[1]