Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

IndexError encountered in SelfCord’s _get_build_number function #81

Open
AkamePro opened this issue Dec 6, 2023 · 1 comment
Open

Comments

@AkamePro
Copy link

AkamePro commented Dec 6, 2023

I’m using the SelfCord library in Python 3.11 and I’ve encountered an issue. When I try to run my bot with the bot.run(config["token"], log_handler=handler) command, I get an IndexError: list index out of range error.
The traceback indicates that the error originates from the _get_build_number function in selfcord\utils.py. Here’s the relevant part of the traceback:

File "C:\Users\arnol\AppData\Local\Programs\Python\Python311\Lib\site-packages\selfcord\utils.py", line 1480, in _get_build_number
build_url = 'https://discord.com/assets/' + re.compile(r'assets/+([a-z0-9]+).js').findall(login_page)[-2] + '.js'
IndexError: list index out of range

It seems like the regular expression re.compile(r'assets/+([a-z0-9]+).js').findall(login_page) is not finding enough matches in login_page, and when it tries to access the penultimate element with [-2], it throws an IndexError.

I’m not sure how to resolve this issue. Any help would be greatly appreciated. Thank you!

@Shell1010
Copy link
Collaborator

not even my library wtf

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants