Captain Ezio commited on
Commit
b8de44c
·
1 Parent(s): acd5cf7

Update info.py

Browse files
Files changed (1) hide show
  1. Powers/plugins/info.py +8 -8
Powers/plugins/info.py CHANGED
@@ -93,17 +93,17 @@ async def get_chat_info(chat_id, already=False):
93
  @Gojo.on_message(command("info"))
94
  async def info_func(_, message: Message):
95
  if message.reply_to_message:
96
- user = message.reply_to_message.from_user.id
97
  elif not message.reply_to_message and len(message.command) == 1:
98
- user = message.from_user.id
99
  elif not message.reply_to_message and len(message.command) != 1:
100
- user = message.text.split(None, 1)[1]
101
 
102
  m = await message.reply_text("Processing...")
103
 
104
  try:
105
- info_caption, photo_id = await get_user_info(user)
106
- LOGGER.info(f"{message.from_user.id} fetched user info of {user} in {message.chat.id}")
107
  except Exception as e:
108
  await m.edit(str(e))
109
  LOGGER.error(e)
@@ -132,13 +132,13 @@ async def chat_info_func(_, message: Message):
132
  )
133
 
134
  if len(message.command) == 1:
135
- chat = message.chat.id
136
  elif len(message.command) == 2:
137
- chat = message.text.split(None, 1)[1]
138
 
139
  m = await message.reply_text("Processing your order.....")
140
 
141
- info_caption, photo_id = await get_chat_info(chat)
142
  if not photo_id:
143
  return await m.edit(
144
  info_caption, disable_web_page_preview=True
 
93
  @Gojo.on_message(command("info"))
94
  async def info_func(_, message: Message):
95
  if message.reply_to_message:
96
+ user_id = message.reply_to_message.from_user.id
97
  elif not message.reply_to_message and len(message.command) == 1:
98
+ user_id = message.from_user.id
99
  elif not message.reply_to_message and len(message.command) != 1:
100
+ user_id = message.text.split(None, 1)[1]
101
 
102
  m = await message.reply_text("Processing...")
103
 
104
  try:
105
+ info_caption, photo_id = await get_user_info(user_id)
106
+ LOGGER.info(f"{message.from_user.id} fetched user info of {user_id} in {message.chat.id}")
107
  except Exception as e:
108
  await m.edit(str(e))
109
  LOGGER.error(e)
 
132
  )
133
 
134
  if len(message.command) == 1:
135
+ chat_id = message.chat.id
136
  elif len(message.command) == 2:
137
+ chat_id = message.text.split(None, 1)[1]
138
 
139
  m = await message.reply_text("Processing your order.....")
140
 
141
+ info_caption, photo_id = await get_chat_info(chat_id)
142
  if not photo_id:
143
  return await m.edit(
144
  info_caption, disable_web_page_preview=True