import time
import misskey as misskey
from client import client_connection
import db_utils as db

from config import NOTIFICATION_POLL_INTERVAL
from notification import process_notifications

if __name__ == '__main__':
    # Initialize the Misskey client
    client = client_connection()
    # Connect to DB
    db.connect()

    print('Listening for notifications...')
    while True:
        if not process_notifications(client):
            time.sleep(NOTIFICATION_POLL_INTERVAL)