Formatted code
This commit is contained in:
11
src/main.py
11
src/main.py
@@ -8,8 +8,10 @@ from mastodon.errors import MastodonError
|
|||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class BotListener(StreamListener):
|
class BotListener(StreamListener):
|
||||||
"""A bot class that listens to incoming notifications"""
|
"""A bot class that listens to incoming notifications"""
|
||||||
|
|
||||||
def __init__(self, mastodon, messages):
|
def __init__(self, mastodon, messages):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.mastodon = mastodon
|
self.mastodon = mastodon
|
||||||
@@ -40,8 +42,11 @@ class BotListener(StreamListener):
|
|||||||
visibility="private",
|
visibility="private",
|
||||||
)
|
)
|
||||||
|
|
||||||
logger.debug("Posted welcome %s and follow-up %s",
|
logger.debug(
|
||||||
welcome["id"], collections["id"])
|
"Posted welcome %s and follow-up %s",
|
||||||
|
welcome["id"],
|
||||||
|
collections["id"],
|
||||||
|
)
|
||||||
|
|
||||||
elif kind == "follow":
|
elif kind == "follow":
|
||||||
logger.info("New follow from %s", acct)
|
logger.info("New follow from %s", acct)
|
||||||
@@ -84,5 +89,7 @@ def main():
|
|||||||
except MastodonError:
|
except MastodonError:
|
||||||
logger.exception("Mastodon streaming error")
|
logger.exception("Mastodon streaming error")
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|||||||
Reference in New Issue
Block a user