fix upload_keys
This commit is contained in:
parent
58dc320048
commit
da1e1df6df
11
README.md
11
README.md
|
@ -18,6 +18,11 @@ Create a virtualenv
|
||||||
source venv/bin/activate
|
source venv/bin/activate
|
||||||
pip install https://git.gaja-group.com/gaja-group/matrix-bot
|
pip install https://git.gaja-group.com/gaja-group/matrix-bot
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
The configuration is stored in `$HOME/.config/matrix-bot/` and resides in directories within that directory.
|
||||||
|
By default the configuration file will be loaded from the `default` profile folder, this can be changed by running `matrix-bot -b PROFILE_NAME COMMANDS...`
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Before you can send encrypted messages you must verify the bot with the matrix homeserver. To to login and do this use `matrix-bot verify`
|
Before you can send encrypted messages you must verify the bot with the matrix homeserver. To to login and do this use `matrix-bot verify`
|
||||||
|
@ -37,3 +42,9 @@ Or start the bot in daemon mode. In this mode the bot will listen for defined ev
|
||||||
cd MATRIX_BOT_DIR
|
cd MATRIX_BOT_DIR
|
||||||
source venv/bin/activate
|
source venv/bin/activate
|
||||||
matrix-bot run
|
matrix-bot run
|
||||||
|
|
||||||
|
When the bot is running and the socket plugin is active you can send messages via the running bot.
|
||||||
|
|
||||||
|
cd MATRIX_BOT_DIR
|
||||||
|
source venv/bin/activate
|
||||||
|
matrix-bot client send '!yourRoomId' "Message Content"
|
||||||
|
|
|
@ -129,6 +129,7 @@ class Bot(object):
|
||||||
return self.__client
|
return self.__client
|
||||||
|
|
||||||
async def __upload_keys(self) -> None:
|
async def __upload_keys(self) -> None:
|
||||||
|
if self.client.should_upload_keys:
|
||||||
await self.client.keys_upload()
|
await self.client.keys_upload()
|
||||||
|
|
||||||
if self.client.should_query_keys:
|
if self.client.should_query_keys:
|
||||||
|
@ -140,12 +141,9 @@ class Bot(object):
|
||||||
|
|
||||||
async def sync(self) -> None:
|
async def sync(self) -> None:
|
||||||
self.logger.debug('Starting sync')
|
self.logger.debug('Starting sync')
|
||||||
next_batch = self.__read_next_batch()
|
await self.__upload_keys()
|
||||||
self.__upload_keys()
|
|
||||||
|
|
||||||
await self.client.sync(timeout=30000,
|
await self.client.sync(timeout=30000, full_state=True)
|
||||||
full_state=True,
|
|
||||||
since=next_batch)
|
|
||||||
|
|
||||||
async def sync_forever(self) -> None:
|
async def sync_forever(self) -> None:
|
||||||
# next_batch = self.__read_next_batch()
|
# next_batch = self.__read_next_batch()
|
||||||
|
|
Loading…
Reference in New Issue