Skip to content

Commit

Permalink
fixing alive media not getting with [DUAL] mode
Browse files Browse the repository at this point in the history
  • Loading branch information
rking32 authored Sep 21, 2020
1 parent e039fbf commit c52fbb8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions userge/plugins/tools/alive.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ async def alive(message: Message):
try:
await _send_alive(message, output, markup)
except (FileIdInvalid, FileReferenceEmpty, BadRequest):
await _refresh_id()
await _refresh_id(message)
await _send_alive(message, output, markup)


Expand All @@ -91,7 +91,7 @@ async def _send_alive(message: Message,
text: str,
reply_markup: Optional[InlineKeyboardMarkup]) -> None:
if not (_LOGO_ID and _LOGO_REF):
await _refresh_id()
await _refresh_id(message)
try:
await message.client.send_cached_media(chat_id=message.chat.id,
file_id=_LOGO_ID,
Expand All @@ -107,13 +107,13 @@ async def _send_alive(message: Message,
disable_web_page_preview=True)


async def _refresh_id() -> None:
async def _refresh_id(message: Message) -> None:
global _LOGO_ID, _LOGO_REF, _IS_STICKER # pylint: disable=global-statement
try:
media = await userge.get_messages(_CHAT, _MSG_ID)
media = await message.client.get_messages(_CHAT, _MSG_ID)
except ChannelInvalid:
_set_data(True)
return await _refresh_id()
return await _refresh_id(message)
else:
if media.sticker:
_IS_STICKER = True
Expand Down

0 comments on commit c52fbb8

Please sign in to comment.