diff --git a/main.py b/its_matrix_bot/__init__.py old mode 100644 new mode 100755 similarity index 87% rename from main.py rename to its_matrix_bot/__init__.py index 94ebc98..856344d --- a/main.py +++ b/its_matrix_bot/__init__.py @@ -1,11 +1,10 @@ -import argparse import datetime from nio.rooms import MatrixRoom from nio.events.room_events import RoomMessage import simplematrixbotlib as botlib -from its_api import ItSyndikatApi -from config import Config +from .its_api import ItSyndikatApi +from .config import Config class ItSyndikatBot: @@ -77,15 +76,3 @@ class ItSyndikatBot: async def spaceping(self, room: MatrixRoom, message: RoomMessage): await self.its_api.ping() await self.reply(room, message, "Hello Space!") - - -if __name__ == "__main__": - parser = argparse.ArgumentParser(description="IT-Syndikat matrix bot") - parser.add_argument( - "-c", "--config", - help="path to the config file", - ) - - args = parser.parse_args() - - ItSyndikatBot(Config(args.config)) diff --git a/its_matrix_bot/__main__.py b/its_matrix_bot/__main__.py new file mode 100644 index 0000000..ac00437 --- /dev/null +++ b/its_matrix_bot/__main__.py @@ -0,0 +1,14 @@ +import argparse + +from . import ItSyndikatBot +from .config import Config + +parser = argparse.ArgumentParser(description="IT-Syndikat matrix bot") +parser.add_argument( + "-c", "--config", + help="path to the config file", +) + +args = parser.parse_args() + +ItSyndikatBot(Config(args.config)) diff --git a/config.py b/its_matrix_bot/config.py similarity index 100% rename from config.py rename to its_matrix_bot/config.py diff --git a/its_api.py b/its_matrix_bot/its_api.py similarity index 96% rename from its_api.py rename to its_matrix_bot/its_api.py index 72fa8e9..9186cf1 100644 --- a/its_api.py +++ b/its_matrix_bot/its_api.py @@ -1,6 +1,6 @@ import aiohttp -from config import Config +from .config import Config class ItSyndikatApi: base_url: str