Readme update, version update, examples update
This commit is contained in:
@@ -6,13 +6,9 @@ def check_environment() -> None:
|
||||
This function checks if required environment variables are set. It prints
|
||||
problem resolution guide and exits using `sys.exit(1)` on problem.
|
||||
"""
|
||||
if "MATRIX_HOMESERVER" not in os.environ:
|
||||
print("Please set `MATRIX_HOMESERVER` environment variable!")
|
||||
print("P.S. use something like this in your shell:")
|
||||
print(" export MATRIX_HOMESERVER=\"https://matrix.server.net\"")
|
||||
if "MAB_SERVER" not in os.environ:
|
||||
print("Please set `MAB_SERVER` environment variable!")
|
||||
sys.exit(1)
|
||||
if "MATRIX_USERNAME" not in os.environ:
|
||||
print("Please set `MATRIX_USERNAME` environment variable!")
|
||||
print("P.S. use something like this in your shell:")
|
||||
print(" export MATRIX_USERNAME=\"megakiller228\"")
|
||||
if "MAB_USER" not in os.environ:
|
||||
print("Please set `MAB_USER` environment variable!")
|
||||
sys.exit(1)
|
||||
@@ -116,8 +116,8 @@ async def main() -> None:
|
||||
check_environment()
|
||||
|
||||
config = MatrixBotConfig(
|
||||
matrix_homeserver_url=os.environ["MATRIX_HOMESERVER"],
|
||||
matrix_username_localpart=os.environ["MATRIX_USERNAME"],
|
||||
matrix_homeserver_url=os.environ["MAB_SERVER"],
|
||||
matrix_username_localpart=os.environ["MAB_USER"],
|
||||
storage_directory="session_storage"
|
||||
)
|
||||
bot = MatrixBot(config)
|
||||
|
||||
@@ -24,8 +24,8 @@ async def main() -> None:
|
||||
check_environment()
|
||||
|
||||
config = MatrixBotConfig(
|
||||
matrix_homeserver_url=os.environ["MATRIX_HOMESERVER"],
|
||||
matrix_username_localpart=os.environ["MATRIX_USERNAME"],
|
||||
matrix_homeserver_url=os.environ["MAB_SERVER"],
|
||||
matrix_username_localpart=os.environ["MAB_USER"],
|
||||
storage_directory="session_storage"
|
||||
)
|
||||
bot = MatrixBot(config)
|
||||
|
||||
@@ -80,8 +80,8 @@ async def main() -> None:
|
||||
check_environment()
|
||||
|
||||
config = MatrixBotConfig(
|
||||
matrix_homeserver_url=os.environ["MATRIX_HOMESERVER"],
|
||||
matrix_username_localpart=os.environ["MATRIX_USERNAME"],
|
||||
matrix_homeserver_url=os.environ["MAB_SERVER"],
|
||||
matrix_username_localpart=os.environ["MAB_USER"],
|
||||
storage_directory="session_storage"
|
||||
)
|
||||
bot = MatrixBot(config)
|
||||
|
||||
@@ -88,8 +88,8 @@ async def main() -> None:
|
||||
check_environment()
|
||||
|
||||
config = MatrixBotConfig(
|
||||
matrix_homeserver_url=os.environ["MATRIX_HOMESERVER"],
|
||||
matrix_username_localpart=os.environ["MATRIX_USERNAME"],
|
||||
matrix_homeserver_url=os.environ["MAB_SERVER"],
|
||||
matrix_username_localpart=os.environ["MAB_USER"],
|
||||
storage_directory="session_storage"
|
||||
)
|
||||
bot = MatrixBot(config)
|
||||
|
||||
@@ -44,8 +44,8 @@ async def main() -> None:
|
||||
check_environment()
|
||||
|
||||
config = MatrixBotConfig(
|
||||
matrix_homeserver_url=os.environ["MATRIX_HOMESERVER"],
|
||||
matrix_username_localpart=os.environ["MATRIX_USERNAME"],
|
||||
matrix_homeserver_url=os.environ["MAB_SERVER"],
|
||||
matrix_username_localpart=os.environ["MAB_USER"],
|
||||
storage_directory="session_storage"
|
||||
)
|
||||
bot = MatrixBot(config)
|
||||
|
||||
@@ -137,8 +137,8 @@ async def main() -> None:
|
||||
logging.getLogger("nio").setLevel(logging.CRITICAL+1)
|
||||
check_environment()
|
||||
config = MatrixBotConfig(
|
||||
matrix_homeserver_url=os.environ["MATRIX_HOMESERVER"],
|
||||
matrix_username_localpart=os.environ["MATRIX_USERNAME"],
|
||||
matrix_homeserver_url=os.environ["MAB_SERVER"],
|
||||
matrix_username_localpart=os.environ["MAB_USER"],
|
||||
storage_directory="session_storage"
|
||||
)
|
||||
bot = MatrixBot(config)
|
||||
|
||||
Reference in New Issue
Block a user