!JiiOHXrIUCtcOJsZCa:matrix.org

nio

357 Members
The nio matrix python library | Latest release 0.4 https://pypi.org/project/matrix-nio/ | Documentation: https://matrix-nio.readthedocs.io/en/stable/137 Servers

Load older messages


SenderMessageTime
5 Jul 2019
@fredcy:ostez.comfredcy [08c3...6ba3]Is there something I should be doing to close cleanly?17:51:20
@poljar:matrix.orgpoljar the close() method on the client object 17:53:15
@fredcy:ostez.comfredcy [08c3...6ba3]That works, but I've got a lot to learn about catching exceptions in the async context.18:19:11
@poljar:matrix.orgpoljar there is a sync_forever() method which you can use that one handles most errors for you and just retries 18:22:15
@poljar:matrix.orgpoljarto handle events that way you can add event callbacks https://matrix-nio.readthedocs.io/en/latest/nio.html#nio.Client.add_event_callback18:23:27
@poljar:matrix.orgpoljarnote that event callbacks need to be normal functions with the latest release of nio but can be awaitable coroutines in master18:23:55
@poljar:matrix.orgpoljar the sync_forever() method also makes sure to make important encryption related requests for you 18:25:18
@fredcy:ostez.comfredcy [08c3...6ba3]Here's what it looks like as I follow along with the guide. https://github.com/fredcy/matrix-nio-test18:46:08
@fredcy:ostez.comfredcy [08c3...6ba3]aside: what are "heroes" in a room?18:48:48
@poljar:matrix.orgpoljar 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:matrix.orgpoljarheroes are user ids that are important to calculate the room name if you're using user lazy loading during a sync18:49:54
@poljar:matrix.orgpoljar you don't need to interact with this at all, the MatrixRoom class will handle room display names for you 18:50:30
@fredcy:ostez.comfredcy [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:matrix.orgpoljaroh right, that's unreleased as well19:33:35
@poljar:matrix.orgpoljarwell good news, there should be a release by the end of the week19:33:52
@fredcy:ostez.comfredcy [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:matrix.orgpoljarpip is always latest tag19:37:29
@fredcy:ostez.comfredcy [08c3...6ba3]I just uninstalled the pip version and reinstalled from a clone of your master branch.19:43:23
@fredcy:ostez.comfredcy [08c3...6ba3] Seems to work. full_state works and now client.rooms has info. Cool. 19:44:19
@poljar:matrix.orgpoljar👌19:44:26
12 Jul 2019
@poljar:matrix.orgpoljar 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:matrix.orggentile joined the room.04:33:47
@gentile:matrix.orggentilehey 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:matrix.orgpoljari'm not aware of anyone using it for a bot yet, some people toyed around07:51:29
@poljar:matrix.orgpoljarhere's one of them https://github.com/fredcy/matrix-nio-test07:51:38
@Nim65s:matrix.orgguilhem 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:matrix.orgpoljaruhm, nio supports E2E as well and it does borrow some parts from zil0's PR08:32:46
@Nim65s:matrix.orgguilhemthen I should try to update my bots to nio, to finally get this E2E, thanks :)08:35:02
@gentile:matrix.orggentilehis github photo looks like a most wanted poster :)16:07:29
@gentile:matrix.orggentilethanks 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

Show newer messages


Back to Room ListRoom Version: 4