TL;DR
If you are not seeing the Copy button located in your bot settings to copy your bot's token, this means the token has already been viewed once and is now hidden. You will need to regenerate the token using the Reset Token button and paste that new token into your code.
WHY DID THE COPY BUTTON DISAPPEAR?
You may have noticed that the copy button has disappeared from the Bot page in the Developer Portal. After you have viewed the token once and leave the page, you no longer have access to it. This is put in place for security reasons. If you forgot to copy your token, it will need to be regenerated and changed in any code where the old one might have been used.
HOW TO REGENERATE YOUR BOT’S TOKEN
- Open your App on the Developer Portal.
- Go to the Bot settings from the side menu.
- Press the Reset Token button located under the Build-a-Bot section.
- A pop-up window will show up asking you to confirm.
- Enter your Two-Factor Authentication code, if requested.
- Your new token will now show up under the Build-A-Bot section. Make sure to copy and paste it into your code right away. Be sure to follow good token management security practices!
⚠️ NOTE: Your code may not work if you were using an older token. You will need to paste this new token in for everything to continue working.