Closed AkamePro closed 6 months ago
I've been looking into this, but don't have time to make the PR.
The fix:
'assets/+([a-z0-9]+)\.js'
in utils.py
needs to include a period now, to
'assets/+([a-z0-9\.]+)\.js'
The HTML now has assets in the following format
<script src="/assets/3726.e3e95df69f8cf8ff7aa8.js" defer
by the way your user token is visible, should hide/change it asap (if you havent already)
@AkamePro - your token is visible, as indicated above.
Duplicate of #619
Summary
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.
Reproduction Steps
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!
Code
Expected Results
Que se ejecute sin problemas
Actual Results
No se inicia sesión
System Information
PS C:\Users\arnol> python -m discord -v Traceback (most recent call last): File "", line 189, in _run_module_as_main
File "", line 148, in _get_module_details
File "", line 112, in _get_module_details
File "C:\Users\arnol\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord__init.py", line 22, in
from . import abc as abc, opus as opus, utils as utils
File "C:\Users\arnol\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\abc.py", line 62, in
from .commands import ApplicationCommand, BaseCommand, SlashCommand, UserCommand, MessageCommand, _command_factory
File "C:\Users\arnol\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\commands\ init__.py", line 26, in
from .context import *
File "C:\Users\arnol\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\commands\context.py", line 30, in
from discord.interactions import Interaction, InteractionMessage, InteractionResponse
ImportError: cannot import name 'InteractionMessage' from 'discord.interactions' (C:\Users\arnol\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\interactions.py)
PS C:\Users\arnol>
Checklist
Additional Information
No response