Merubokkusu / Discord-S.C.U.M

A Discord API Wrapper for Userbots/Selfbots written in Python.
MIT License
581 stars 170 forks source link

Big guilds cause a gateway error and it wont work afterwards #436

Open HelloIshHere opened 1 year ago

HelloIshHere commented 1 year ago

Exception ignored in thread started by: <bound method GatewayServer._response_loop of <discum.gateway.gateway.GatewayServer object at 0x0000025ECB93FD50>> Traceback (most recent call last): File "C:\Users\Ish\AppData\Roaming\Python\Python38\site-packages\discum\gateway\gateway.py", line 299, in _response_loop func(resp) File "test.py", line 29, in helloworld bot.gateway.subscribeToGuildEvents(wait=1000) File "C:\Users\Ish\AppData\Roaming\Python\Python38\site-packages\discum\gateway\gateway.py", line 490, in subscribeToGuildEvents imports.GuildCombo(self).subscribeToGuildEvents(onlyLarge, wait) File "C:\Users\Ish\AppData\Roaming\Python\Python38\site-packages\discum\gateway\guild\combo.py", line 167, in subscribeToGuildEvents guildIDs = s.guildIDs File "C:\Users\Ish\AppData\Roaming\Python\Python38\site-packages\discum\gateway\session.py", line 55, in guildIDs return [guildID for guildID in self.guilds if "removed" not in self.guilds[guildID]] File "C:\Users\Ish\AppData\Roaming\Python\Python38\site-packages\discum\gateway\session.py", line 47, in guilds return self.settings_ready['guilds'] KeyError: 'guilds'

HelloIshHere commented 1 year ago

import discum bot = discum.Client(token='', log=True) @bot.gateway.command def helloworld(resp): if resp.event.ready_supplemental: bot.gateway.subscribeToGuildEvents(wait=1) if resp.event.message: m = resp.parsed.auto() guildID = m['guild_id'] if 'guild_id' in m else None #because DMs are technically channels too channelID = m['channel_id'] username = m['author']['username'] discriminator = m['author']['discriminator'] content = m['content'] print("> guild {} channel {} | {}#{}: {}".format(guildID, channelID, username, discriminator, content))

bot.gateway.run()

guilds are minecraft, fortnite etc those big guilds.

HelloIshHere commented 1 year ago

For most guilds it works afterwards but the bigger ones are problematic sorry.