Ask coding questions

← Back to all posts
Storing Values Question
PatrickRienzo (1)

Hey everyone,

I built a discord bot in python that posts scores from a web site. I have a task running on a loop to check the web site to see if the score of the game is there and if so, it posts it. I only want the score posted once though.

To do this, I created a separate file that has the match url and whether or not it has been written. All the "written" values start out as "N" and the task checks against this value before posting. Once it posts, it changes the value to a "Y" so it no longer posts.

This mostly works... However, I've noticed that sometimes scores will post multiple times. The only thing I can think of is that the repl is reverting to an older version of the file where the value of the game was still "N".

Any ideas?

The task in my code starts at line 853.