#Problem with an event

10 messages · Page 1 of 1 (latest)

final daggerBOT
  • Consider reading #how-to-get-help to improve your question!
  • Explain what exactly your issue is.
  • Post the full error stack trace, not just the top part!
  • Show your code!
  • Issue solved? Press the button!
glass slateBOT

If you aren't getting any errors, try to place console.log checkpoints throughout your code to find out where execution stops.

  • Once you do, log relevant values and if-conditions
  • More sophisticated debugging methods are breakpoints and runtime inspections: learn more
halcyon dune

Your watchPlayerGames on an interval makes no sense. You update the table with its very own data every second?

What parts? You literally update it with the data you got from the very same database table

And you didn’t show where you listen to that event

You have a djs bot, you already know how to listen to events and do something each time that event emits. interactionCreate event for example. Or ready event

But you don’t actually listen to that custom event of yours anywhere, do you?

The interval happens automatically yes. But that has nothing to do with any event emitting

halcyon dune

I‘m still not even understanding what is supposed to happen on that event. Since you literally get all entries from the players table to then write their values back to that same players table. Which won‘t change a thing in the database

halcyon dune

But currently you use neither of those tables. Instead you use the recent_games column in the players table