Revert because stuck

This commit is contained in:
yasirarism 2023-04-30 21:13:59 +07:00 committed by GitHub
parent 24b6ed159e
commit 1bb054b2ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 30 deletions

View file

@ -81,7 +81,7 @@ if __name__ == "__main__":
pass pass
except Exception: except Exception:
err = traceback.format_exc() err = traceback.format_exc()
print(err) LOGGER.info(err)
finally: finally:
loop.stop() loop.stop()
print("------------------------ Stopped Services ------------------------") LOGGER.info("------------------------ Stopped Services ------------------------")

View file

@ -155,14 +155,15 @@ async def imdb_search_id(kueri, message):
) )
buttons.add(*BTN) buttons.add(*BTN)
msg = await k.edit_caption(msg, reply_markup=buttons) msg = await k.edit_caption(msg, reply_markup=buttons)
await msg.wait_for_click( try:
from_user_id=message.from_user.id, await msg.wait_for_click(
timeout=30 from_user_id=message.from_user.id,
) timeout=30
except ListenerTimeout: )
await msg.edit_caption("😶‍🌫️ Waktu Habis. Task Telah Dibatalkan!") except ListenerTimeout:
await msg.edit_caption("😶‍🌫️ Waktu Habis. Task Telah Dibatalkan!")
except Exception as err: except Exception as err:
await msg.edit_caption(f"Ooppss, gagal mendapatkan daftar judul di IMDb. Mungkin terkena rate limit atau down.\n\n<b>ERROR:</b> <code>{err}</code>") await k.edit_caption(f"Ooppss, gagal mendapatkan daftar judul di IMDb. Mungkin terkena rate limit atau down.\n\n<b>ERROR:</b> <code>{err}</code>")
async def imdb_search_en(kueri, message): async def imdb_search_en(kueri, message):
@ -211,14 +212,15 @@ async def imdb_search_en(kueri, message):
) )
buttons.add(*BTN) buttons.add(*BTN)
msg = await k.edit_caption(msg, reply_markup=buttons) msg = await k.edit_caption(msg, reply_markup=buttons)
await msg.wait_for_click( try:
from_user_id=message.from_user.id, await msg.wait_for_click(
timeout=30 from_user_id=message.from_user.id,
) timeout=30
except ListenerTimeout: )
await msg.edit_caption("😶‍🌫️ Timeout. Task Has Been Cancelled!") except ListenerTimeout:
await msg.edit_caption("😶‍🌫️ Timeout. Task Has Been Cancelled!")
except Exception as err: except Exception as err:
await msg.edit_caption(f"Failed when requesting movies title. Maybe got rate limit or down.\n\n<b>ERROR:</b> <code>{err}</code>") await k.edit_caption(f"Failed when requesting movies title. Maybe got rate limit or down.\n\n<b>ERROR:</b> <code>{err}</code>")
@app.on_callback_query(filters.regex("^imdbcari")) @app.on_callback_query(filters.regex("^imdbcari"))
@ -263,14 +265,15 @@ async def imdbcari(self: Client, query: CallbackQuery):
) )
buttons.add(*BTN) buttons.add(*BTN)
msg = await query.message.edit_caption(msg, reply_markup=buttons) msg = await query.message.edit_caption(msg, reply_markup=buttons)
await msg.wait_for_click( try:
from_user_id=int(uid), await msg.wait_for_click(
timeout=30 from_user_id=int(uid),
) timeout=30
except ListenerTimeout: )
await msg.edit_caption("😶‍🌫️ Waktu Habis. Task Telah Dibatalkan!") except ListenerTimeout:
await msg.edit_caption("😶‍🌫️ Waktu Habis. Task Telah Dibatalkan!")
except Exception as err: except Exception as err:
await msg.edit_caption(f"Ooppss, gagal mendapatkan daftar judul di IMDb. Mungkin terkena rate limit atau down.\n\n<b>ERROR:</b> <code>{err}</code>") await query.message.edit_caption(f"Ooppss, gagal mendapatkan daftar judul di IMDb. Mungkin terkena rate limit atau down.\n\n<b>ERROR:</b> <code>{err}</code>")
else: else:
if query.from_user.id != int(uid): if query.from_user.id != int(uid):
return await query.answer("⚠️ Access Denied!", True) return await query.answer("⚠️ Access Denied!", True)
@ -308,14 +311,15 @@ async def imdbcari(self: Client, query: CallbackQuery):
) )
buttons.add(*BTN) buttons.add(*BTN)
msg = await query.message.edit_caption(msg, reply_markup=buttons) msg = await query.message.edit_caption(msg, reply_markup=buttons)
await msg.wait_for_click( try:
from_user_id=int(uid), await msg.wait_for_click(
timeout=30 from_user_id=int(uid),
) timeout=30
except ListenerTimeout: )
await msg.edit_caption("😶‍🌫️ Timeout. Task Has Been Cancelled!") except ListenerTimeout:
return await msg.edit_caption("😶‍🌫️ Timeout. Task Has Been Cancelled!")
except Exception as err: except Exception as err:
await msg.edit_caption(f"Failed when requesting movies title. Maybe got rate limit or down.\n\n<b>ERROR:</b> <code>{err}</code>") await query.message.edit_caption(f"Failed when requesting movies title. Maybe got rate limit or down.\n\n<b>ERROR:</b> <code>{err}</code>")
@app.on_callback_query(filters.regex("^imdbres_id")) @app.on_callback_query(filters.regex("^imdbres_id"))