Advertisement
disk6969

pyro get call + title

Aug 17th, 2023 (edited)
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.70 KB | None | 0 0
  1. from pyrogram.raw.functions.channels import GetFullChannel
  2. from pyrogram.raw.functions.phone import EditGroupCallTitle
  3. from pyrogram.raw.functions.phone import GetGroupCall
  4.  
  5. async def get_input_call(chat_id):
  6.   return (
  7.     await app.invoke(GetFullChannel(channel=await app.resolve_peer(chat_id)))
  8.   ).full_chat.call
  9.  
  10. async def get_call_title(chat_id):
  11.   input_call = await get_input_call(chat_id)
  12.   if not input_call: return
  13.   return (await app.invoke(GetGroupCall(call=input_call, limit=0))).call.title
  14.  
  15. async def edit_call_title(chat_id, title):
  16.   input_call = await get_input_call(chat_id)
  17.   if not input_call: return
  18.   return await app.invoke(EditGroupCallTitle(call=input_call, title=title))
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement