5 Jul 2019 |
fredcy [08c3...6ba3] | Is there something I should be doing to close cleanly? | 17:51:20 |
poljar | the close() method on the client object | 17:53:15 |
fredcy [08c3...6ba3] | That works, but I've got a lot to learn about catching exceptions in the async context. | 18:19:11 |
poljar | there is a sync_forever() method which you can use that one handles most errors for you and just retries | 18:22:15 |
poljar | to handle events that way you can add event callbacks https://matrix-nio.readthedocs.io/en/latest/nio.html#nio.Client.add_event_callback | 18:23:27 |
poljar | note that event callbacks need to be normal functions with the latest release of nio but can be awaitable coroutines in master | 18:23:55 |
poljar | the sync_forever() method also makes sure to make important encryption related requests for you | 18:25:18 |
fredcy [08c3...6ba3] | Here's what it looks like as I follow along with the guide.
https://github.com/fredcy/matrix-nio-test | 18:46:08 |
fredcy [08c3...6ba3] | aside: what are "heroes" in a room? | 18:48:48 |
poljar | on a glance looks good, but keep in mind, nio doesn't store/restore the room state; so your first sync needs to make sure to fetch the room state using the full_state argument of the sync() method | 18:49:27 |
poljar | heroes are user ids that are important to calculate the room name if you're using user lazy loading during a sync | 18:49:54 |
poljar | you don't need to interact with this at all, the MatrixRoom class will handle room display names for you | 18:50:30 |
fredcy [08c3...6ba3] | When I try response = await client.sync(30000, full_state=True) I get "TypeError: sync() got an unexpected keyword argument 'full_state'" | 19:03:29 |
poljar | oh right, that's unreleased as well | 19:33:35 |
poljar | well good news, there should be a release by the end of the week | 19:33:52 |
fredcy [08c3...6ba3] | Yeah, I just noticed that what's in master at github doesn't match what I've got via pip. | 19:36:37 |
poljar | pip is always latest tag | 19:37:29 |
fredcy [08c3...6ba3] | I just uninstalled the pip version and reinstalled from a clone of your master branch. | 19:43:23 |
fredcy [08c3...6ba3] | Seems to work. full_state works and now client.rooms has info. Cool. | 19:44:19 |
poljar | 👌 | 19:44:26 |
12 Jul 2019 |
| poljar changed the room topic to "The nio matrix python library | Latest release 0.4 https://pypi.org/project/matrix-nio/ | Documentation: https://matrix-nio.readthedocs.io/en/stable/" from "The nio matrix python library | Latest release 0.3 https://pypi.org/project/matrix-nio/ | Documentation: https://matrix-nio.readthedocs.io/en/stable/". | 08:45:11 |
14 Jul 2019 |
| gentile joined the room. | 04:33:47 |
gentile | hey all, i need a matrix bot that uses e2e. i installed nio and the weechat plugin. i see most e2e isn't implemented in the weechat plugin but the nio library looks fairly complete. is anyone actively using it for a e2e-aware bot? | 04:37:50 |
poljar | i'm not aware of anyone using it for a bot yet, some people toyed around | 07:51:29 |
poljar | here's one of them https://github.com/fredcy/matrix-nio-test | 07:51:38 |
guilhem | gentile: with zil0's PR to matrix-python-sdk, E2E is supposed to work: https://github.com/matrix-org/matrix-python-sdk/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aopen+E2E | 08:29:33 |
poljar | uhm, nio supports E2E as well and it does borrow some parts from zil0's PR | 08:32:46 |
guilhem | then I should try to update my bots to nio, to finally get this E2E, thanks :) | 08:35:02 |
gentile | his github photo looks like a most wanted poster :) | 16:07:29 |
gentile | thanks for pointing me in the right direction. i had a basic bot working in matrix-python-sdk 6 months back but the sdk wasn't stable. will switch to nio. beautiful code and nice work. | 16:08:24 |