dolfies / discord.py-self

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

ValueError: invalid literal for int() with base 10: 'ER_V2_' #599

Closed dixlyn closed 4 months ago

dixlyn commented 11 months ago

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_superproperties = 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: 'ERV2'

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_superproperties = 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: 'ERV2'

System Information

Checklist

Additional Information

the same code used to work for years

dBorea commented 8 months ago

+1

l-404-l commented 8 months ago

Build and use from github repo package on pip is out of date atm

dolfies commented 4 months ago

Fixed the fallback! The API is back up too. Sorry for the wait guys.