#Counting system isnt working

1 messages · Page 1 of 1 (latest)

late birch
#

I think it’s a problem with your database, not pycord

#

I don’t have a lot of experience with databases, but I assume you defined an entry to have 4 values, guildID channelID number and lastuserID
so you should pass 4 values or create a default value for lastuserID

#

Idk, like I said don’t have a lot of experience

#

I just know how to break them 😅

late birch
#

You never defined it, there is no variable lastuser

late birch
#

Read your error messages

#

Msg is not defined

#

But still, msg is not defined

#

msg = …

#

you just need an lastuserid, correct?

#

Use -1 for initialization or something

fathom wolf
#

If I'm not wrong

fathom wolf
late birch
fathom wolf
#

Huh

#

Then what is?

late birch
#

a default value like -1 or something

fathom wolf
#

No?

late birch
#

of course

fathom wolf
#

And if it doesnt it's a pycord error

late birch
#

I never said it would fail, it's just not a good way for initializing a database

fathom wolf
#

where did you read that from?

#

Or see

late birch
#

it says set up the counter

#

and inserts a new channel to the database

late birch
#

I suggest -1
from the context I assume you’re writing a counting bot (or feature)
lastuserID will be the person who counted the last number.
Since everyone should be able to start, -1 will not match any discord user id, interaction.user.id on the other hand would restrict the person who used the command for initialization to start the first count.