diff --git a/bukubot/__main__.py b/bukubot/__main__.py index 238772b..60e85a9 100644 --- a/bukubot/__main__.py +++ b/bukubot/__main__.py @@ -22,9 +22,6 @@ import sys # bookmarks_db.search_keywords_and_filter_by_tags # bookmarks_db.exclude_results_from_search - - - def main(): # Setup the command line arguments. parser = ArgumentParser(description=Client.__doc__) @@ -58,9 +55,6 @@ def main(): # have interdependencies, the order in which you register them does # not matter. xmpp = Client(args.jid, args.password) - xmpp.connect() - xmpp.process() - if __name__ == '__main__': main() diff --git a/bukubot/xmpp/client.py b/bukubot/xmpp/client.py index f704dbb..05c42be 100644 --- a/bukubot/xmpp/client.py +++ b/bukubot/xmpp/client.py @@ -63,6 +63,9 @@ class Client(slixmpp.ClientXMPP): self.add_event_handler("message", self.process_message) self.add_event_handler("disco_info", self.process_disco_info) + self.connect() + self.process() + async def process_session_start(self, event): """ Process the session_start event.