Running Python 3.7. I'm trying to use client.logs_from(), but neither of the ways the API explains how to use it, work.
async for message in client.logs_from(self.channel, limit=5, after=self.statusMessage):
ret += 1
raises a TypeError: 'async for' received an object from __aiter__ that does not implement __anext__: generator.
yield from client.logs_from() doesn't seem to be called at all. In fact, when I include it in the definition of a method, it refuses to run the method entirely. That is:
def blah():
print("hi")
ret = yield from client.logs_from(ctx.message.channel)
blah()
doesn't print hi.
Am I doing something wrong?
The async version of the library, which you're most likely using because of client.logs_from, doesn't even support Python 3.7. Did you change some of the internal files to make it work?
I don't remember doing so, but I must have at some point if it doesn't support 3.7. Does it support 3.6 or should I go back to 3.5?
It seems like you're using the async branch with Python 3.7.
I assume you installed from the repository and updated all the dependencies to get it working?
This is an issue with Python 3.7 (where support for asynchronous __aiter__ was dropped as proposed) which likely will not be fixed on the async branch.
You should either downgrade to Python <=3.6 or switch to the rewrite branch.
It supports 3.6. Alternatively, upgrade to the rewrite branch (v1.0.0a). For more information, join the official discord.py server.
just to make sure, is the API reference still accurate for the rewrite branch, or is there a separate thing?
edit: I just found the separate thing
There is separate version of documentation for the rewrite branch.
You can manually switch between versions with the Read the Docs UI menu.
Like @MusicOnline said, for further information about the rewrite branch, you should join the official discord.py server.
alright, thank you
Make it work with 3.8
The async branch is deprecated, so that's not going to happen.