Skip to content
This repository was archived by the owner on Apr 15, 2026. It is now read-only.
This repository was archived by the owner on Apr 15, 2026. It is now read-only.

[BUG] set_account_data and get_account_data not working correctly #40

@jostrk

Description

@jostrk

Describe the bug
When trying to use set_account_data and get_account_data we encountered the following error:

/venv/lib/python3.9/site-packages/niobot/client.py:1479: RuntimeWarning: coroutine 'AsyncClient.send' was never awaited
  async with self.send(method, path, data, {"Content-Type": "application/json"}) as response:
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
ERROR:bot:Command "hello" error: __aenter__

Additionally it seems that both get_account_data and set_account_data do not pass the necessary authorization headers to the underlying (matrix-nio) send function.

Finally set_account_data seems to expect a json object rather than the dict as defined in the documentation:

set_account_data(
    key: [str], data: [dict], *, room_id: [str] = None
) -> None

To Reproduce

d = {"test": "value"}
await self.bot.set_account_data("test.type", d)
val = await self.bot.get_account_data("test.type")

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions