forked from nolan/titlebot-ng-ng
Removed dead file.
This commit is contained in:
@@ -1,39 +0,0 @@
|
||||
import yaml
|
||||
import re
|
||||
import asyncio
|
||||
import sqlite3
|
||||
from nio import AsyncClient, LoginResponse, RoomSendResponse, RoomMessageText, SyncResponse
|
||||
import time
|
||||
from post import Post
|
||||
from room import Room
|
||||
|
||||
async def main():
|
||||
room = Room()
|
||||
|
||||
if not await room.login_to_matrix():
|
||||
print("Failed to login")
|
||||
return
|
||||
|
||||
# Initial sync establishes the next-batch; after this, listen from "now"
|
||||
await room.client.sync(timeout=3000)
|
||||
listen_since_ms = int(time.time() * 1000)
|
||||
|
||||
room.get_last_run()
|
||||
last_post = getattr(room, "last_run", None)
|
||||
if last_post:
|
||||
print(f"Last run for this room was at UNIX timestamp {last_post}")
|
||||
|
||||
# Wait for !gettitles before posting
|
||||
await asyncio.wait_for(room.wait_for_gettitles(since_ms=listen_since_ms), timeout=None)
|
||||
|
||||
# Then read and post
|
||||
room.read_db(since_timestamp=last_post, only_unposted=True)
|
||||
await room.post_suggestions()
|
||||
await room.close()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
while True:
|
||||
asyncio.run(main())
|
||||
time.sleep(2)
|
||||
|
||||
Reference in New Issue
Block a user