Do instances of discord.py objects stay in sync to reality?

Viewed 61

I'm building a discord bot with discord.py. I'm writing a test that adds a reaction to a Message using the add_reaction method. My Message instance is not reflecting the changes, though they are visible in the server. I've added a refresh of the instance to the test to get around it.

My question is: do the instances of messages (or other classes) need to be refreshed on each use to match the most recent state in the guild or do they sync on their own?

Thanks!

1 Answers

No, it doesn't update automatically. You'll have to use channel.history to read the updated messages. More here.

Related