Ask coding questions

← Back to all posts
Class | COGS | Error | Discord.py
DwellerIgor (1)

Hello there! I was trying to use one of my projects as a cog in a different project, but I keep getting some errors. Please help me. Btw look in the twitchnotifs.py file. Thank you!!!

Comments
hotnewtop
InvisibleOne (3215)

Everything seems good, the error looks like you have the wrong name for a token in your keys. On line 21 in your cogs file. The key error means there is no key called access_token, maybe you spelled it wrong?

DwellerIgor (1)

no, look at my replies to coder down below @InvisibleOne

Coder100 (18904)

Do you know which errors?

DwellerIgor (1)

sure, like this one AttributeError: 'twitchnotifs' object has no attribute 'live_notifs_loop' I think there might be problems with self. @Coder100

Coder100 (18904)

oh i see, yeah it is an issue. You didn't define it as a method! So remove the self. modifier, so it's like: live_notifs_loop
@DwellerIgor

DwellerIgor (1)

oh, but then i get another issue: TypeError: live_notifs_loop() missing 1 required positional argument: 'self'@Coder100

DwellerIgor (1)

but if i totaly remove self from live_notifs_loop (line 49) I get this: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)@Coder100

DwellerIgor (1)

maybe something else it is? @Coder100