Archived
1
0
Fork 0

fix: failed to send messages in load_prompt (#1019)

Signed-off-by: xtex <xtexchooser@duck.com>
This commit is contained in:
xtex 2023-11-12 23:46:08 +08:00 committed by GitHub
parent ccaab20a22
commit d1422a896d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -178,11 +178,18 @@ async def start():
# set device name # set device name
asyncio.create_task(bot.update_device(client.device_id, {"display_name": client.device_name})) asyncio.create_task(bot.update_device(client.device_id, {"display_name": client.device_name}))
# sync joined room state
Logger.info(f"starting sync room full state")
# bot.upload_filter(presence={'limit':1},room={'timeline':{'limit':1}})
resp = await bot.sync(timeout=10000, since=bot.next_batch, full_state=True, set_presence='unavailable')
await bot._handle_invited_rooms(resp)
await bot._handle_joined_rooms(resp)
await init_async() await init_async()
await load_prompt(FetchTarget) await load_prompt(FetchTarget)
Logger.info(f"starting sync loop") Logger.info(f"starting sync loop")
await bot.sync_forever(timeout=30000, full_state=True, set_presence='online') await bot.sync_forever(timeout=30000, full_state=False, set_presence='online')
Logger.info(f"sync loop stopped") Logger.info(f"sync loop stopped")
if bot.olm: if bot.olm: