discord.py-self
discord.py-self copied to clipboard
API error
Summary
Info API Down
Reproduction Steps
Just started out, used the most basic option possible, straight from the doc page.
Code
import discord
class MyClient(discord.Client):
async def on_ready(self):
print(f'Logged on as {self.user}!')
async def on_message(self, message):
print(f'Message from {message.author}: {message.content}')
client = MyClient()
client.run('token')
Expected Results
should have connected to discord
Actual Results
2024-04-12 00:34:10 INFO discord.client Logging in using static token.
2024-04-12 00:34:27 WARNING discord.utils Info API down. Falling back to manual fetching...
Traceback (most recent call last):
File "/root/selfbot/selfbot.py", line 73, in
System Information
- Python v3.10.12-final
- discord.py-self v2.0.0-final
- aiohttp v3.9.4
- system info: Linux 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024
Checklist
- [X] I have searched the open issues for duplicates.
- [X] I have shared the entire traceback.
- [X] I am using a user token (and it isn't visible in the code).
Additional Information
No response
I was able to fix the problem in the v2.0 release by editing the build URL and build index to match the updated files from discord.
utils.py
line 1474 build_url = 'https://discord.com/assets/' + re.compile(r'assets/+([a-z0-9]+\.[a-z0-9]+)\.js').findall(login_page)[-2] + '.js'
line 1477 build_index = build_file.find('buildNumber') + 26
It returned the correct build number (284187 currently) and then I could log in.
I was able to fix the problem in the v2.0 release by editing the build URL and build index to match the updated files from discord.
utils.py line 1474
build_url = 'https://discord.com/assets/' + re.compile(r'assets/+([a-z0-9]+\.[a-z0-9]+)\.js').findall(login_page)[-2] + '.js'line 1477
build_index = build_file.find('buildNumber') + 26It returned the correct build number (
284187currently) and then I could log in.
I too am having a similar issue however this fix did not work for me assuming the build number has changed since, hopefully a more permanent solution is established soon.
The version available on PyPI (Python Package Index) is outdated. You can install the latest version directly from GitHub using this command:
pip install git+https://github.com/dolfies/discord.py-self.git
Fixed the fallback! The API is back up too. Sorry for the wait guys.