dolfies / discord.py-self

A fork of the popular discord.py for user accounts.
https://discordpy-self.rtfd.io/en/latest/
MIT License
648 stars 153 forks source link

List Index is out of range #659

Closed TwangyMoney closed 1 month ago

TwangyMoney commented 5 months ago

Summary

Gives an error saying list index is out of range.

Reproduction Steps

image It's a big selfbot, with a lot of requirements. I'm using discord.py-self with selfcord.py and discord. I've tried other selfbots made by my friends they gave the same error.

Code

from discord_webhook import DiscordWebhook
from brainfuckery import Brainfuckery
#from modules.youtubeclass import *
import discord
#from discord import Embed, app_commands
from discord.ext import commands
from modules.functions import *
from modules.variables import *
import morse_talk as mtalk
from textwrap import wrap
import randfacts
import requests
import pyfiglet
import discord
import random
import string
import base64
import qrcode
import socket
import openai
import time
import json
import os

# Bot stuff
bot = commands.Bot(command_prefix=prefix, self_bot=True, help_command=None)

Expected Results

it's supposed to login as me in my account and I should have been able to do commands.

Actual Results

Throws an error after saying info api is down.

System Information

Checklist

Additional Information

[2024-02-05 22:48:24] [INFO ] discord.client: Logging in using static token. [2024-02-05 22:48:24] [WARNING ] discord.utils: Info API down. Falling back to manual fetching... Traceback (most recent call last): File "", line 189, in _run_module_as_main File "", line 112, in _get_module_details File "G:\main.py", line 72, in client.run(token) File "C:\Users\Twangy Money\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\discord\client.py", line 938, in run asyncio.run(runner()) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2032.0_x64qbz5n2kfra8p0\Lib\asyncio\runners.py", line 190, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2032.0_x64qbz5n2kfra8p0\Lib\asyncio\runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2032.0_x64__qbz5n2kfra8p0\Lib\asyncio\base_events.py", line 653, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "C:\Users\Twangy Money\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\discord\client.py", line 927, in runner await self.start(token, reconnect=reconnect) File "C:\Users\Twangy Money\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\discord\client.py", line 857, in start await self.login(token) File "C:\Users\Twangy Money\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\discord\client.py", line 698, in login data = await state.http.static_login(token.strip()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Twangy Money\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\discord\http.py", line 991, in static_login await self.startup() File "C:\Users\Twangy Money\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\discord\http.py", line 562, in startup self.super_properties, self.encoded_superproperties = sp, = await utils._get_info(session) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Twangy Money\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\discord\utils.py", line 1446, in _get_info bn = await _get_build_number(session) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Twangy Money\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\discord\utils.py", line 1474, 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
ucjd commented 5 months ago

download the directory as zip and go to ur site packages on python and replace the "discord" folder with the one in the zip, should look like this "C:\Users\Admin\AppData\Local\Programs\Python\Python311\Lib\site-packages"

s1nistr4 commented 4 months ago

Getting this too, the pypi package should be updated to match the latest discord api

Danipulok commented 4 months ago

Getting this too for about two weeks. Linux. It was working fine before for half a year.

UPD: Well,

pip install git+https://github.com/dolfies/discord.py-self.git

solved the case.

Danipulok commented 4 months ago

@dolfies could you please upgrade PyPi package to match current code and solve this issue?

AndKe commented 4 months ago
AndKe commented 4 months ago

installed current master, and it works fine. please make a release. :)

dolfies commented 1 month ago

Fixed the fallback! The API is back up too. Sorry for the wait guys. The PyPi package should work again as the API is back.

wastu01 commented 1 month ago

tks