Summary
this bug started to happen after discord updated their api
Reproduction Steps
File "main.py", line 14, in
client.run("TOKEN")
File "/home/runner/zersy/venv/lib/python3.8/site-packages/discord/client.py", line 938, in run
asyncio.run(runner())
File "/nix/store/2vm88xw7513h9pyjyafw32cps51b0ia1-python3-3.8.12/lib/python3.8/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/nix/store/2vm88xw7513h9pyjyafw32cps51b0ia1-python3-3.8.12/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "/home/runner/zersy/venv/lib/python3.8/site-packages/discord/client.py", line 927, in runner
await self.start(token, reconnect=reconnect)
File "/home/runner/zersy/venv/lib/python3.8/site-packages/discord/client.py", line 857, in start
await self.login(token)
File "/home/runner/zersy/venv/lib/python3.8/site-packages/discord/client.py", line 698, in login
data = await state.http.static_login(token.strip())
File "/home/runner/zersy/venv/lib/python3.8/site-packages/discord/http.py", line 991, in static_login
await self.startup()
File "/home/runner/zersy/venv/lib/python3.8/site-packages/discord/http.py", line 562, in startup
self.super_properties, self.encoded_super_properties = sp, _ = await utils._get_info(session)
File "/home/runner/zersy/venv/lib/python3.8/site-packages/discord/utils.py", line 1446, in _get_info
bn = await _get_build_number(session)
File "/home/runner/zersy/venv/lib/python3.8/site-packages/discord/utils.py", line 1478, in get_build_number
return int(build_file[build_index : build_index + 6])
ValueError: invalid literal for int() with base 10: 'ER_V2'
Code
import sys
import discord
client = discord.Client(command_prefix="?")
@client.event
async def on_ready():
print(f'Logged in as {client.user} (ID: {client.user.id})')
activity = discord.CustomActivity(name="testing this", emoji=discord.PartialEmoji(name="6barbie", id=1072916912373235852))
await client.change_presence(status=discord.Status.idle, activity=activity)
client.run("TOKEN")
Expected Results
should work and update the tokens discords status and custom emoji
Actual Results
File "main.py", line 14, in
client.run("TOKEN")
File "/home/runner/zersy/venv/lib/python3.8/site-packages/discord/client.py", line 938, in run
asyncio.run(runner())
File "/nix/store/2vm88xw7513h9pyjyafw32cps51b0ia1-python3-3.8.12/lib/python3.8/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/nix/store/2vm88xw7513h9pyjyafw32cps51b0ia1-python3-3.8.12/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "/home/runner/zersy/venv/lib/python3.8/site-packages/discord/client.py", line 927, in runner
await self.start(token, reconnect=reconnect)
File "/home/runner/zersy/venv/lib/python3.8/site-packages/discord/client.py", line 857, in start
await self.login(token)
File "/home/runner/zersy/venv/lib/python3.8/site-packages/discord/client.py", line 698, in login
data = await state.http.static_login(token.strip())
File "/home/runner/zersy/venv/lib/python3.8/site-packages/discord/http.py", line 991, in static_login
await self.startup()
File "/home/runner/zersy/venv/lib/python3.8/site-packages/discord/http.py", line 562, in startup
self.super_properties, self.encoded_super_properties = sp, _ = await utils._get_info(session)
File "/home/runner/zersy/venv/lib/python3.8/site-packages/discord/utils.py", line 1446, in _get_info
bn = await _get_build_number(session)
File "/home/runner/zersy/venv/lib/python3.8/site-packages/discord/utils.py", line 1478, in get_build_number
return int(build_file[build_index : build_index + 6])
ValueError: invalid literal for int() with base 10: 'ER_V2'
System Information
- Python v3.8.12-final
- discord.py-self v2.0.0-final
- aiohttp v3.8.3
- system info: Linux 6.2.0-1018-gcp #20~22.04.1-Ubuntu SMP Mon Oct 23 12:29:43 UTC 2023
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
the same code used to work for years
Build and use from github repo package on pip is out of date atm
Fixed the fallback! The API is back up too. Sorry for the wait guys.