dolfies / discord.py-self

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

lib taking an extremely long time (if not forever) to load #455

Closed spookware closed 1 year ago

spookware commented 1 year ago

Summary

The lib is taking way too long to load.

Reproduction Steps

Run code

Code

import discord
import os

os.system(" ")
print("Starting SPOOKWARE...")

bot = discord.Client()
async def on_ready():
        print('Logged on as' + bot.user)

async def on_message(message):

        if message.content == 'ping':
            await message.channel.send('pong')

Expected Results

The account should be logged into much faster, basically instantly

Actual Results

Nothing really happens. Just spend alot of time waiting for the on_ready() print.

System Information

Checklist

Additional Information

No response

Iinksafe commented 1 year ago

Set chunk_guilds_on_startup to False if your client is in large servers.

dolfies commented 1 year ago

The API URL the current stable version depends on no longer exists as the domain was revoked. A fallback exists, but it retries fetching the API a few times causing a delay. Additionally, if you are in many guilds, you can pass guild_subscription_options=discord.GuildSubscriptionOptions.off() to disable the no longer very reliable fetching of guild members at startup for certain guilds. I recommend installing the current alpha through the master branch, which resolves both of these issues and adds the aforementioned chunk_guilds_on_startup parameter.

spookware commented 1 year ago

I've added chunks_guilds_on_startup, to no avail. Can you please explain how I install the current alpha through the master branch?

devAshton commented 1 year ago

This is happening for me as well. I have a clean install and everything, bot turns online and works just takes extremely long to print or do anything in the on_ready function. I've tried the things above and everything is still taking forever.

spookware commented 1 year ago

@devAshton I've managed to get mine working. Can you send your code, either here or on discord (spook#0001) and I'll take a glance and see if there's anything I can immediately notice?

dakiba commented 1 year ago

It seems:

client = discord.Client(chunks_guilds_on_startup=False)

do nothing, its takes super long still.

client = discord.Client(guild_subscription_options=discord.GuildSubscriptionOptions.off())

results into AttributeError: module 'discord' has no attribute 'GuildSubscriptionOptions

I use discord.py-self 2.0.0a2