mastodon-ld/masto_ld/main.py

18 lines
443 B
Python

from typing import Optional
from masto_ld.config import Config
from masto_ld.bots.mastodon import Bot
from time import sleep
def masto_ld(config:Optional[Config]=None):
if config is None:
config = Config()
bot = Bot(config=config)
try:
bot.init_stream()
while True:
sleep(60*60)
bot.logger.info('taking a breath')
except KeyboardInterrupt:
bot.logger.info('quitting!')