This commit is contained in:
@@ -8,3 +8,15 @@ Dies ist eine neuentwicklung für Matrix, des bisher unter Discord laufenden Bot
|
|||||||
|
|
||||||
## limits
|
## limits
|
||||||
- this bot only supports handling with unencryptet channels!
|
- this bot only supports handling with unencryptet channels!
|
||||||
|
|
||||||
|
## usage
|
||||||
|
1. fill the conf file
|
||||||
|
2. run the bot
|
||||||
|
|
||||||
|
hint: the password can be set as env var
|
||||||
|
|
||||||
|
## env vars
|
||||||
|
|
||||||
|
var | description | value options
|
||||||
|
--- | --- | ---
|
||||||
|
MATRIX_BOT_PASSWORD | password for the bot, overrides config! | string
|
||||||
|
|||||||
@@ -46,7 +46,8 @@ class MatrixBot:
|
|||||||
self.domain = self._config['general']['domain']
|
self.domain = self._config['general']['domain']
|
||||||
self.homeserver = f"https://{self.domain}"
|
self.homeserver = f"https://{self.domain}"
|
||||||
self.username = f"@{self._config['general']['user']}:{self._config['general']['domain']}"
|
self.username = f"@{self._config['general']['user']}:{self._config['general']['domain']}"
|
||||||
self.__password = self._config['general']['pass']
|
# get password from env or fallback from config file
|
||||||
|
self.__password = os.environ.get('MATRIX_BOT_PASSWORD') or self._config['general']['pass']
|
||||||
del self._config['general']['pass']
|
del self._config['general']['pass']
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@@ -154,6 +155,7 @@ class MatrixBot:
|
|||||||
|
|
||||||
async def run(self):
|
async def run(self):
|
||||||
if await self._login():
|
if await self._login():
|
||||||
|
del self.__password
|
||||||
await self.send_status(f"{self.botname} Online!")
|
await self.send_status(f"{self.botname} Online!")
|
||||||
await self._activate_skills()
|
await self._activate_skills()
|
||||||
await self.client.sync_forever(timeout=30000, set_presence='online')
|
await self.client.sync_forever(timeout=30000, set_presence='online')
|
||||||
|
|||||||
Reference in New Issue
Block a user