mirror of
https://github.com/TeamPGM/PagerMaid_Plugins_Pyro.git
synced 2024-11-21 21:18:05 +00:00
xtaodada
fb5a3f5baf
All checks were successful
Github commit to telegram / build (push) Successful in 13s
16 lines
443 B
Python
16 lines
443 B
Python
import contextlib
|
|
|
|
from pyrogram.raw.functions.account import UpdateStatus
|
|
|
|
from pagermaid.services import bot, scheduler
|
|
from pagermaid.utils.bot_utils import log
|
|
|
|
|
|
@scheduler.scheduled_job("interval", seconds=55, id="keep_online")
|
|
async def keep_online():
|
|
try:
|
|
await bot.invoke(UpdateStatus(offline=False))
|
|
except Exception as e:
|
|
with contextlib.suppress(Exception):
|
|
await log(f"Keep online failed: {e}")
|