discord.py-self icon indicating copy to clipboard operation
discord.py-self copied to clipboard

invalid literal for int() with base 10: ',"2820'

Open ERmak148 opened this issue 10 months ago • 2 comments

Summary

This error occurred while trying to log in

Reproduction Steps

How did you make it happen? I just using this lib

Code

import discord
import discord.ext.commands

TOKEN = '...'

SERVER_ID = ...
CHANNEL_ID = ...

client = discord.ext.commands.Bot(command_prefix="!!", self_bot=True)

@client.event
async def on_ready():
    print(f'We have logged in as {client.user}')

@client.event
async def on_message(message):
    if message.channel.id == CHANNEL_ID and message.guild.id == SERVER_ID:
        print(f'{message.author}: {message.content}')

client.run(TOKEN)


2024-04-06 18:19:12 INFO     discord.client Logging in using static token.
2024-04-06 18:19:30 WARNING  discord.utils Info API down. Falling back to manual fetching...
Traceback (most recent call last):
  File "C:\Users\ermak\Desktop\sob\main.py", line 22, in <module>
    client.run(TOKEN)
  File "C:\Users\ermak\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 938, in run
    asyncio.run(runner())
  File "C:\Users\ermak\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "C:\Users\ermak\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 649, in run_until_complete
    return future.result()
  File "C:\Users\ermak\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 927, in runner
    await self.start(token, reconnect=reconnect)
  File "C:\Users\ermak\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 857, in start
    await self.login(token)
  File "C:\Users\ermak\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 698, in login
    data = await state.http.static_login(token.strip())
  File "C:\Users\ermak\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\http.py", line 991, in static_login
    await self.startup()
  File "C:\Users\ermak\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\http.py", line 562, in startup
    self.super_properties, self.encoded_super_properties = sp, _ = await utils._get_info(session)
  File "C:\Users\ermak\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\utils.py", line 1446, in _get_info
    bn = await _get_build_number(session)
  File "C:\Users\ermak\AppData\Local\Programs\Python\Python310\lib\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: ',"2820'

Expected Results

a working program

Actual Results

a broken program

System Information

  • Python v3.10.9-final
  • discord.py-self v2.0.0-final
  • aiohttp v3.8.6
  • system info: Windows 10 10.0.19045

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

ERmak148 avatar Apr 06 '24 14:04 ERmak148

I get the message "discord.errors.LoginFailure: Improper token has been passed" if I change return int(build_file[build_index : build_index + 9]) to return 282068

ERmak148 avatar Apr 06 '24 14:04 ERmak148

install from git source with pip install git+https://github.com/dolfies/discord.py-self.git@master

falafelp avatar Apr 07 '24 13:04 falafelp

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

dolfies avatar May 15 '24 01:05 dolfies