Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'user' #137

Open
Aries298 opened this issue Feb 13, 2022 · 65 comments
Open

KeyError: 'user' #137

Aries298 opened this issue Feb 13, 2022 · 65 comments
Labels
Dependency Bug Issue is caused from one of the dependencies

Comments

@Aries298
Copy link

I'm trying to pinpoint the issue and thought I might ask about it here. The bot runs on Replit without any issues but it suddenly stopped working. After restarting it gives the following error:
errrore

@vivinano
Copy link
Owner

Seems your discord token might have changed so check that

@ChocoTonic
Copy link

no I believe it's an issue with discum because I just got the error as well. let me know if it is still working on your end

@vivinano
Copy link
Owner

It could be an issue with discum.

It currently is working for me personally When I ran it when the issue first arose.

If it was installed thru pypi then it's an older version of discum

Which should be installed thru their GitHub repo

@ChocoTonic
Copy link

could I know what version of discum you're using?

what specifically is working for you? discum or mudaeautobot?

discum is personally still working for me on other scripts still but it's specifically this line
user = bot.gateway.session.user
and anything related to gateway.session that is giving that keyerror

this is the output that I'm getting

image

@vivinano
Copy link
Owner

I'm currently on discum 1.3.1

@Epikest
Copy link

Epikest commented Feb 16, 2022

i'm getting the same issue, have tried 1.3.1 from github releases, 1.4.0 from github releases, and latest from pypi

@ChocoTonic
Copy link

i'm getting the same issue, have tried 1.3.1 from github releases, 1.4.0 from github releases, and latest from pypi

is it failing on 1.3.1 also for you?

@Epikest
Copy link

Epikest commented Feb 17, 2022

i'm getting the same issue, have tried 1.3.1 from github releases, 1.4.0 from github releases, and latest from pypi

is it failing on 1.3.1 also for you?

yep

@vivinano
Copy link
Owner

okay viewing the discum repo there has been a captcha added that i think is messing with the key error.
I've emailed the dev over there and am awaiting for a reply

@Epikest
Copy link

Epikest commented Feb 17, 2022

thanks

@Epikest
Copy link

Epikest commented Feb 17, 2022

if discum doesn't work, you can use discord.py-self, it's well maintained

@ChocoTonic
Copy link

moving there would have a lot of overhead, but yeah that's an option

@vivinano
Copy link
Owner

yeah I originally was on discord.py before the self bot portion of code was deprecated and I personally wouldn't like to overhaul the code again. Also in terms of development the same guy who works on discum works on discord.py-self so I'm sure he is figuring out a fix

@vivinano
Copy link
Owner

vivinano commented Feb 19, 2022

still awaiting a reply but haven't received anything on my end. anyone else figured out a solution while we wait ?

@vivinano
Copy link
Owner

vivinano commented Mar 6, 2022

@vivinano vivinano added the Dependency Bug Issue is caused from one of the dependencies label Mar 6, 2022
@Epikest
Copy link

Epikest commented Mar 13, 2022

anything yet?

@vivinano
Copy link
Owner

vivinano commented Mar 13, 2022 via email

@ChocoTonic
Copy link

there isn't a way to just remove the broken section?

@vivinano
Copy link
Owner

vivinano commented Mar 28, 2022 via email

@MujurID
Copy link

MujurID commented Apr 20, 2022

i think in "#take care of channels" in /discum/gateway/start/parse.py , because if i disable i can get ready_data or ready_data["user"]

image

.

i logged out of some servers which have string """ or ''' in topic section i think. now bot can run
(I left from ZeroTwo Bot server) because I found this in my discord response
image
image
image

@ChocoTonic
Copy link

Can you be more specific about what you changed or did differently?

@aspectlostx
Copy link

aspectlostx commented Apr 29, 2022

Just now started receiving this last night, been using it for probably 2 weeks straight with no errors and changes were only made to wish characters. I changed the token as It renewed. Put it inside the quotation marks. no weird spacing or any error. I also went to discum and updated it as I saw changes made this month. Still no luck.

Edit - Still broken even switching from python 3.10.4 to 3.7 and uninstalling/reinstalling discum. Hope to get a fix soon :(

@Idiot1183
Copy link

How was this fixed?

@aspectlostx
Copy link

How was this fixed?

Think they were just referencing you to this page instead of having two open. Not fixed yet

@aspectlostx
Copy link

After trying to fix it, i see it can work perfectly fine on alt accounts but not my main account. I have reset my token by changing my password, doing a lot of things. No luck.. Maybe discord has some sort of shadowbans?? I'm not sure why my main account no longer works with this bot. @MujurID maybe its something to do with servers?? do you think that for this bot?

@Idiot1183
Copy link

After trying to fix it, i see it can work perfectly fine on alt accounts but not my main account. I have reset my token by changing my password, doing a lot of things. No luck.. Maybe discord has some sort of shadowbans?? I'm not sure why my main account no longer works with this bot. @MujurID maybe its something to do with servers?? do you think that for this bot?

But that can't be. The same user token works on another discum program that I made. bot.gateway.session.user is the problem.

@aspectlostx
Copy link

After trying to fix it, i see it can work perfectly fine on alt accounts but not my main account. I have reset my token by changing my password, doing a lot of things. No luck.. Maybe discord has some sort of shadowbans?? I'm not sure why my main account no longer works with this bot. @MujurID maybe its something to do with servers?? do you think that for this bot?

But that can't be. The same user token works on another discum program that I made. bot.gateway.session.user is the problem.

Very odd then. My discord token purely does not work anymore, changing it and making sure its 100% correct (like refreshing multiple times, changing passwords) Me then deciding to use it on an alt account that only has 3 servers with its token worked.. But yeah who knows. You're right too its not the bot perse. It's just discum.

@aspectlostx
Copy link

aspectlostx commented May 8, 2022

@vivinano - Confirmed I just fixed it by getting rid of mostly all my servers I don't need anymore. I do not know what server specifically made it work and I know this makes zero sense as the problem is based on the user and discum but @MujurID 's solution does work (for me). Might have to do with a certain string as they mention certain servers/channels may have characters that conflict? No clue.

@kleborgn
Copy link

Leaving all the hubs I was in fixed the error for me

@ChocoTonic
Copy link

how can I identify which servers I'm in are hubs? @kleborgn

@kleborgn
Copy link

how can I identify which servers I'm in are hubs? @kleborgn

The icon is blue with a student hat. If you right-click on it, it says "Leave the hub" instead of "Leave the server".

image

@ChocoTonic
Copy link

I see. I don't have any hubs, but I am in large servers and it does not work for me

@aspectlostx
Copy link

I see. I don't have any hubs, but I am in large servers and it does not work for me

Check on a new alt account. I still am running the bot on two accounts with no issues since the fix I said worked. Just try leaving servers you do not need anymore. Hubs aren't the only cause

@ScikuVRC
Copy link

Exception ignored in thread started by: <bound method GatewayServer._response_loop of <discum.gateway.gateway.GatewayServer object at 0x000002B223FA3CD0>> Traceback (most recent call last): File "C:\Users\USER\AppData\Roaming\Python\Python310\site-packages\discum\gateway\gateway.py", line 299, in _response_loop func(resp) File "C:\Users\USER\AppData\Local\Programs\Python\Python310\MudaeAutoBot-4\MudaeAutoBot.py", line 694, in on_message c_settings = parse_settings_message(msg) File "C:\Users\USER\AppData\Local\Programs\Python\Python310\MudaeAutoBot-4\MudaeAutoBot.py", line 223, in parse_settings_message settings['prefix'] = val_parse(settings_p[0])[0] IndexError: list index out of range

Tried all the fixes above, even tried the thing @MujurID suggested, nothing seems to make the bot function.

@vivinano
Copy link
Owner

`Exception ignored in thread started by: <bound method GatewayServer._response_loop of <discum.gateway.gateway.GatewayServer object at 0x000002B223FA3CD0>>

Traceback (most recent call last):

File "C:\Users\USER\AppData\Roaming\Python\Python310\site-packages\discum\gateway\gateway.py", line 299, in _response_loop

func(resp)

File "C:\Users\USER\AppData\Local\Programs\Python\Python310\MudaeAutoBot-4\MudaeAutoBot.py", line 694, in on_message

c_settings = parse_settings_message(msg)

File "C:\Users\USER\AppData\Local\Programs\Python\Python310\MudaeAutoBot-4\MudaeAutoBot.py", line 223, in parse_settings_message

settings['prefix'] = val_parse(settings_p[0])[0]

IndexError: list index out of range`

Tried all the fixes above, even tried the thing @MujurID suggested, nothing seems to make the bot function.

That because this isn't a keyword user error and falls within the invalid settings error

@BellaDona007
Copy link

I had solved this problem by leaving some servers, but now it's back and I have no idea what happened or who I should look for to get this error out =\

@ScikuVRC
Copy link

Normal Syntax doesn't work but, installing latest Discum + copying all Mudae $settings in the Channeldata folder has started the bot and made it use slash commands. So better than nothing.

@strongtaste57
Copy link

I'm having the same error. In my case it's a specific server that for some reason triggers the error. I tried on an alt account and as expected, the bot runs fine until I join the server. Tried making a dummy server similar to it, to pinpoint exactly what causes it, but I couldn't find the culprit. Attempted to add an exception in /discum/gateway/start/parse.py for this specific server ID but I couldn't get it to work. I cannot leave this server, so any help would be appreciated.

@vivinano
Copy link
Owner

The developer for discum should be back not sure how long he was going on break but might have to contact him

@vivinano
Copy link
Owner

vivinano commented Aug 1, 2022

The dev of discum should be back from hiatus so can some one confirm if this has been resolved

@tranbtho98
Copy link

tranbtho98 commented Aug 10, 2022

Found a way to temporary fix this without deleting any channels, for my case. Discum 1.4.1
Go to your discum package folder: /discum/gateway/types.py. Add some type under channelTypes. For instance:
channelTypes = {
0: "guild_text",
1: "dm",
2: "guild_voice",
3: "group_dm",
4: "guild_category",
5: "guild_news",
6: "guild_store",
10: "guild_news_thread",
11: "guild_public_thread",
12: "guild_private_thread",
13: "guild_stage_voice",
14: "type_14",
15: "type_15"
}
It seems like discord add some kind of honeypot type of channel? The guild parsing got index out of bound due to the extra number of type. The code below was replaced under #take_care_of_channels only to find what channel causing the error for debugging only.
image
Thanks @MujurID for the lead.

@jodersi
Copy link

jodersi commented Aug 10, 2022

Just got this issue and was able to fix it by leaving a server that just started using the new forum feature on discord.

@vivinano
Copy link
Owner

Found a way to temporary fix this without deleting any channels, for my case. Discum 1.4.1

Go to your discum package folder: /discum/gateway/types.py. Add some type under channelTypes. For instance:

channelTypes = {

  0: "guild_text",

  1: "dm",

  2: "guild_voice",

  3: "group_dm",

  4: "guild_category",

  5: "guild_news",

  6: "guild_store",

  10: "guild_news_thread",

  11: "guild_public_thread",

  12: "guild_private_thread",

  13: "guild_stage_voice",

  14: "type_14",

  15: "type_15"

}

It seems like discord add some kind of honeypot type of channel? The guild parsing got index out of bound due to the extra number of type. The code below was replaced under #take_care_of_channels only to find what channel causing the error for debugging only.

image

Thanks @MujurID for the lead.

I think this looks pretty valid as a fix I would love to test it but I haven't ran into the issue myself

I would recommend anyone having the issue to try this fix as it doesn't seem to be to big of a change to functionality

@tranbtho98 if you get enough successful results I think you could report your finding to the discum developer and it will help him implement the code in his library

@vivinano
Copy link
Owner

Exception ignored in thread started by: <bound method GatewayServer._response_loop of <discum.gateway.gateway.GatewayServer object at 0x00000291B334BCD0>> Traceback (most recent call last): File "C:\Users\Sciku\AppData\Roaming\Python\Python310\site-packages\discum\gateway\gateway.py", line 299, in _response_loop func(resp) File "C:\Users\Sciku\AppData\Local\Programs\Python\Python310\Abysmally\MudaeAutoBot.py", line 748, in on_message slashfus = threading.Timer(10.0,waifu_roll,args=[slashchannel,slashget,slashguild]) UnboundLocalError: local variable 'slashget' referenced before assignment

This just recently started happening, no file change, does anyone know if latest discum broke it or fixes it?

this is a different issue not regarding user issue this is an issue with discum which I made a bug fixes in their latest version of their repo. but if it still not working the newer code version of my code has resolved this issue

Plesae do not use this issue to report other issues that are not involving USER issue thank you

Repository owner deleted a comment from ScikuVRC Aug 15, 2022
@ahykono
Copy link

ahykono commented Aug 20, 2022

So is this keyword error going to be fixed or not? Has it been sorted out

@BellaDona007
Copy link

Found a way to temporary fix this without deleting any channels, for my case. Discum 1.4.1 Go to your discum package folder: /discum/gateway/types.py. Add some type under channelTypes. For instance: channelTypes = { 0: "guild_text", 1: "dm", 2: "guild_voice", 3: "group_dm", 4: "guild_category", 5: "guild_news", 6: "guild_store", 10: "guild_news_thread", 11: "guild_public_thread", 12: "guild_private_thread", 13: "guild_stage_voice", 14: "type_14", 15: "type_15" } It seems like discord add some kind of honeypot type of channel? The guild parsing got index out of bound due to the extra number of type. The code below was replaced under #take_care_of_channels only to find what channel causing the error for debugging only. image Thanks @MujurID for the lead.

Thank you very much, that's the only way to solve it

@BellaDona007
Copy link

Now this has started to appear
image

@XLThinOreos1
Copy link

Found a way to temporary fix this without deleting any channels, for my case. Discum 1.4.1 Go to your discum package folder: /discum/gateway/types.py. Add some type under channelTypes. For instance: channelTypes = { 0: "guild_text", 1: "dm", 2: "guild_voice", 3: "group_dm", 4: "guild_category", 5: "guild_news", 6: "guild_store", 10: "guild_news_thread", 11: "guild_public_thread", 12: "guild_private_thread", 13: "guild_stage_voice", 14: "type_14", 15: "type_15" } It seems like discord add some kind of honeypot type of channel? The guild parsing got index out of bound due to the extra number of type. The code below was replaced under #take_care_of_channels only to find what channel causing the error for debugging only. image Thanks @MujurID for the lead.

this does not work for me

@kleborgn
Copy link

kleborgn commented Nov 5, 2022

This fork of discum fixed it for me: https://github.com/ericz/Discord-S.C.U.M

@ChocoTonic
Copy link

which fork exactly? @kleborgn

@vivinano
Copy link
Owner

vivinano commented Nov 6, 2022

This fork of discum fixed it for me: https://github.com/ericz/Discord-S.C.U.M

Look like the only change I see is a different capability code with self.auth

@ChocoTonic
Copy link

This fork of discum fixed it for me: https://github.com/ericz/Discord-S.C.U.M

Look like the only change I see is a different capability code with self.auth

so is it fixed now?
did you figure out which fork they were talking about?

@Yuriyalloween
Copy link

#215 (comment)

@vivinano
Copy link
Owner

Ive pushed a attempted update to try to fix user issue but needs more settings.
I seen that with a user that has the user error the gateway is still up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dependency Bug Issue is caused from one of the dependencies
Projects
None yet
Development

No branches or pull requests