dolfies / discord.py-self

A fork of the popular discord.py for user accounts.
https://discordpy-self.rtfd.io/en/latest/
MIT License
683 stars 162 forks source link

NameError: name 'accept_invite' is not defined #321

Closed bwlok closed 2 years ago

bwlok commented 2 years ago

Summary

I tried to use the accept_invite function but it gives me a is not defined error

Reproduction Steps

try to run: await accept_invite("https://discord.gg/code")

Code

No response

Expected Results

It should accept the invite

Actual Results

gave a "is not defined" error

System Information

Checklist

Additional Information

No response

5t0n1e commented 2 years ago

Try await client.accept_invite('just the code not the link')

bwlok commented 2 years ago

Try await client.accept_invite('just the code not the link')

Now it says AttributeError: 'MyClient' object has no attribute 'accept_invite'

dolfies commented 2 years ago

Client.accept_invite() is only present in the alpha version of the library. Install it from git to use the alpha.

bwlok commented 2 years ago

Client.accept_invite() is only present in the alpha version of the library. Install it from git to use the alpha.

with python3 -m pip install git+https://github.com/dolfies/discord.py-self right?

if yes it gives me: Traceback (most recent call last): File "/Users/bwlok/Music/SelfTango.py", line 70, in bot.run("token") File "/Users/bwlok/Library/Python/3.9/lib/python/site-packages/discord/client.py", line 727, in run asyncio.run(runner()) File "/Applications/Xcode-beta.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/Applications/Xcode-beta.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete return future.result() File "/Users/bwlok/Library/Python/3.9/lib/python/site-packages/discord/client.py", line 724, in runner await self.start(*args, **kwargs) File "/Users/bwlok/Library/Python/3.9/lib/python/site-packages/discord/client.py", line 697, in start await self.login(token) File "/Users/bwlok/Library/Python/3.9/lib/python/site-packages/discord/client.py", line 568, in login data = await state.http.static_login(token.strip()) File "/Users/bwlok/Library/Python/3.9/lib/python/site-packages/discord/http.py", line 660, in static_login await self.startup() File "/Users/bwlok/Library/Python/3.9/lib/python/site-packages/discord/http.py", line 378, in startup self.user_agent, self.browser_version, self.client_build_number = ua, bv, bn = await utils._get_info(session) File "/Users/bwlok/Library/Python/3.9/lib/python/site-packages/discord/utils.py", line 1246, in _get_info bn = await _get_build_number(session) File "/Users/bwlok/Library/Python/3.9/lib/python/site-packages/discord/utils.py", line 1255, in _get_build_number login_page = await login_page_request.text() File "/Users/bwlok/Library/Python/3.9/lib/python/site-packages/aiohttp/client_reqrep.py", line 1076, in text await self.read() File "/Users/bwlok/Library/Python/3.9/lib/python/site-packages/aiohttp/client_reqrep.py", line 1032, in read self._body = await self.content.read() File "/Users/bwlok/Library/Python/3.9/lib/python/site-packages/aiohttp/streams.py", line 344, in read raise self._exception aiohttp.client_exceptions.ClientPayloadError: 400, message='Can not decode content-encoding: br'

bwlok commented 2 years ago

fixed with updating aiohttp