Discord-S.C.U.M icon indicating copy to clipboard operation
Discord-S.C.U.M copied to clipboard

'guilds' missing in Session.settings_ready

Open 0-Vince opened this issue 2 years ago • 13 comments

Exception ignored in thread started by: <bound method GatewayServer._response_loop of <discum.gateway.gateway.GatewayServer object at 0x00000236281D12A0>>
Traceback (most recent call last):
  File "C:\Users\vilko\AppData\Roaming\Python\Python39\site-packages\discum\gateway\gateway.py", line 303, in _response_loop
    function(resp, **params)
  File "C:\Users\vilko\AppData\Roaming\Python\Python39\site-packages\discum\gateway\guild\combo.py", line 70, in fetchMembers
    if not self.gatewayobj.session.guild(guild_id).hasMembers and reset:
  File "C:\Users\vilko\AppData\Roaming\Python\Python39\site-packages\discum\gateway\session.py", line 233, in hasMembers
    if self.guildID not in Session.settings_ready['guilds']:
KeyError: 'guilds'

I keep getting this error when trying to fetch server members, and yes my account is in the guild which members I'm trying to fetch.

0-Vince avatar Aug 20 '22 19:08 0-Vince

import discum

bot = discum.Client(token='token', log=True)


def close_after_fetching(resp, guild_id):
    if bot.gateway.finishedMemberFetching(guild_id):
        lenmembersfetched = len(bot.gateway.session.guild(guild_id).members)  # this line is optional
        print(str(lenmembersfetched) + ' members fetched')  # this line is optional
        bot.gateway.removeCommand({'function': close_after_fetching, 'params': {'guild_id': guild_id}})
        bot.gateway.close()


def get_members(guild_id, channel_id):
    bot.gateway.fetchMembers(guild_id, channel_id, keep="all",
                             wait=1)  # get all user attributes, wait 1 second between requests
    bot.gateway.command({'function': close_after_fetching, 'params': {'guild_id': guild_id}})
    bot.gateway.run()
    bot.gateway.resetSession()  # saves 10 seconds when gateway is run again
    return bot.gateway.session.guild(guild_id).members


members = get_members('267624335836053506', '267631170882240512')  # yes, the channel_id input is required

This is my code

0-Vince avatar Aug 20 '22 19:08 0-Vince

Hello, if you find solution please tell Im also stuck here

logangwe avatar Aug 29 '22 19:08 logangwe

i have the same issue anyone knows a solution?

Le-git-hub avatar Aug 30 '22 09:08 Le-git-hub

same issue

Phizilion avatar Sep 07 '22 17:09 Phizilion

i have the same issue. the code worked fine before but now it can't run

thomasbutcher551 avatar Sep 16 '22 18:09 thomasbutcher551

bump

Daddy-Talpapa avatar Sep 22 '22 03:09 Daddy-Talpapa

bump

did anyone find a fix

freezpdsd avatar Sep 24 '22 23:09 freezpdsd

bump

did anyone find a fix

#428

ahihiyou20 avatar Sep 25 '22 00:09 ahihiyou20

same....

matukaking avatar Oct 14 '22 11:10 matukaking

error?

diniz-LG avatar Nov 03 '22 00:11 diniz-LG

bump

bfrederick18 avatar Dec 20 '22 22:12 bfrederick18

KeyError: 'guilds'

SoldoxD avatar Jan 20 '23 18:01 SoldoxD

Solution is mentioned in #428

umer007khan avatar Feb 19 '23 11:02 umer007khan