#Currency Cog not loading in

1 messages · Page 1 of 1 (latest)

haughty hill
#

Hi, I need a bit of help...

One of my Cogs (specifically the one with all the currency commands isn't loading) for some reason.

There seems to be no apparent error in my code, and everything was running fine till earlier today

Now, a few hours after my last check in, my bot had gone offline (I ran out of Heroku Dyno hours x_x). So I redeployed my bot from my alt heroku. This is when things went south. Now my currency cog wont load in, and isn't working on my local machine either

Any advice?
I'll edit in any code necessary once somebody responds

Edit: grammar

wicked stratus
#

(if you recently upgraded to 2.0.0, you may need to add store=False in your load_extension function for errors to raise properly; in a future update, store=False will be the default to combat this.)

haughty hill
wicked stratus
#

so for example, when loading cogs you're probably doing something like bot.load_extension("...")

#

oh before that, can you check your version real quick

#

can simply be done by printing discord.__version__

haughty hill
#

I'm definitely 2.0.0

#

I upgraded a few days ago so I'm pretty sure about that

wicked stratus
#

rightright, there was a rework on extension loading that changed some default error behavior; this will be modified in the next release

#

for now, you should do bot.load_extension("...", store=False) to get the old behavior back

haughty hill
#

Okay! I'll try this and get back to you

#

Brb

wicked stratus
#

alright

haughty hill
#

Its gonna take me a while...I've been summoned for dinner

I apologise in case I've kept you waiting

haughty hill
wicked stratus
#

the 2.0 release

#

specifically pr ##1423

void kayakBOT
wicked stratus
#

fwiw it's a good pr overall, but the default behavior being changed confused quite a few people so pr ##1520 changes the default back

void kayakBOT
haughty hill
#

aight
thanks!
Im just redeploying

#

All my other cogs load in just fine though...its just the currency cog that doesnt load in

haughty hill
#

okay thank you so much, Nelo

turns out it was just a teeeny tiny error in my code which was causing the problem...
something to do with psycopg, and how I had pulled user records :p

wicked stratus
#

nicenice

haughty hill
#

NO not nice i feel stupid 😄

solid jasper
wicked stratus
#

with store=False, errors are raised directly and should be output to console

#

with store=True, if there are any errors a dict is returned that maps the cog to the traceback

solid jasper
#

try:
bot.load_extention()
except:
print(E)

#

Wont work then

wicked stratus
#

with store=False that works, but not with store=True

solid jasper
#

😩 ugh updates here i come

#

🤣 💯

#

How does store=True save the dict?

wicked stratus
#

it's returned

#

so something like x = bot.load_extension()

solid jasper
#

So you can the simply do that

wicked stratus
#

then you can check if there's anything in the dict and print the errors

solid jasper
#

And then check for the error value in the dict

wicked stratus
#

or that

solid jasper
#

Okay that's work able

wicked stratus
#

this is especially useful with the rework because you can load multiple cogs with a single function call

solid jasper
#

Will this system change anytime soon again?

wicked stratus
#

i don't think so? only the default behavior is being reverted

solid jasper
wicked stratus
#

that's fine, then just keep using it with store=False

solid jasper
#

Okay thanks for the info

haughty hill
#

may i close this post?

wicked stratus
#

oops