JohnnyApplesauce
JohnnyApplesauce

Reputation: 181

Discord bot hosted on Heroku is an earlier version of itself that was seemingly never pushed

Order of events: I made a bot, signing it up for Discord and all, without doing anything regarding Heroku. I put a certain placeholder string in the source of a bot I wrote. I tested it on my server by running from my own machine. I then implemented that function of the bot and replaced the placeholder string; this string is no longer in the source. The machine then started posting twice when hosting on my machine; one version posting the placeholder string, and another doing the updated action. I then uploaded my local bot project onto Heroku git. It now only posts once; it only posts the placeholder string. In other words, a version of the bot that I never put on Heroku is running.

3 questions, all intertwined:

WHY?

HOW?

HOW do I make the updated version of the bot post?

Upvotes: 1

Views: 120

Answers (2)

Mxlvin
Mxlvin

Reputation: 300

Discord allows a bot to be hosted multiple times. If you can't or don't know how to stop the previous bot from running, I'd recommend changing the token, and add a command that can only be executed by you that stops the bot (a killswitch) just in case this happens again.

Upvotes: 0

Tin Nguyen
Tin Nguyen

Reputation: 5330

I put a certain placeholder string in the source of a bot I wrote. I tested it on my server by running from my own machine. I then implemented that function of the bot and replaced the placeholder string; this string is no longer in the source. The machine then started posting twice when hosting on my machine; one version posting the placeholder string, and another doing the updated action.

You can run a Discord on the same token multiple times. You likely didn't shutdown the bot and ran the bot twice. One with the old code and one with the new code.

I then uploaded my local bot project onto Heroku git. It now only posts once; it only posts the placeholder string. In other words, a version of the bot that I never put on Heroku is running.

Make sure your changes are on the git master branch. Your master branch contains the old source.

Upvotes: 1

Related Questions