Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
3 tasks done
ERmak148 opened this issue Apr 6, 2024 · 3 comments
Closed
3 tasks done

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

ERmak148 opened this issue Apr 6, 2024 · 3 comments
Labels
duplicate This issue or pull request already exists

Comments

@ERmak148
Copy link

ERmak148 commented Apr 6, 2024

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

  • I have searched the open issues for duplicates.
  • I have shared the entire traceback.
  • I am using a user token (and it isn't visible in the code).

Additional Information

No response

@ERmak148 ERmak148 added the unconfirmed bug Unconfirmed bug label Apr 6, 2024
@ERmak148
Copy link
Author

ERmak148 commented Apr 6, 2024

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

@ghost
Copy link

ghost commented Apr 7, 2024

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

@dolfies dolfies added duplicate This issue or pull request already exists and removed unconfirmed bug Unconfirmed bug labels May 15, 2024
@dolfies
Copy link
Owner

dolfies commented May 15, 2024

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

@dolfies dolfies closed this as not planned Won't fix, can't repro, duplicate, stale May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants