OmegaDevStudio / Selfcord-Old

A discord selfbot API wrapper.
MIT License
39 stars 18 forks source link

IndexError encountered in SelfCord’s _get_build_number function #81

Open AkamePro opened 8 months ago

AkamePro commented 8 months ago

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 commented 8 months ago

not even my library wtf