kemoverse/bot/bot_app.py

25 lines
719 B
Python

import time
import misskey as misskey
from client import client_connection
import db_utils as db
from config import NOTIFICATION_POLL_INTERVAL, USE_WHITELIST
from notification import process_notifications
if __name__ == '__main__':
# Initialize the Misskey client
client = client_connection()
# Connect to DB
db.connect()
# Setup default administrators
db.setup_administrators()
# Show whitelist status
whitelist_status = "enabled" if USE_WHITELIST else "disabled"
print(f'Instance whitelisting: {whitelist_status}')
print('Listening for notifications...')
while True:
if not process_notifications(client):
time.sleep(NOTIFICATION_POLL_INTERVAL)