diff --git a/src/main.py b/src/main.py index 6fd37ac..3687d7f 100644 --- a/src/main.py +++ b/src/main.py @@ -8,8 +8,10 @@ from mastodon.errors import MastodonError logger = logging.getLogger(__name__) + class BotListener(StreamListener): """A bot class that listens to incoming notifications""" + def __init__(self, mastodon, messages): super().__init__() self.mastodon = mastodon @@ -40,8 +42,11 @@ class BotListener(StreamListener): visibility="private", ) - logger.debug("Posted welcome %s and follow-up %s", - welcome["id"], collections["id"]) + logger.debug( + "Posted welcome %s and follow-up %s", + welcome["id"], + collections["id"], + ) elif kind == "follow": logger.info("New follow from %s", acct) @@ -84,5 +89,7 @@ def main(): except MastodonError: logger.exception("Mastodon streaming error") raise + + if __name__ == "__main__": main()