diff options
author | 2022-11-20 14:00:20 -0800 | |
---|---|---|
committer | 2022-11-20 14:00:20 -0800 | |
commit | 56eaa94d33a75c1ab61956d886c3e18b568900ff (patch) | |
tree | 7d6a6588e3afb7216468c9114f91aee851ba6c07 | |
parent | Merge pull request #789 from python-discord/messages-in-past-n-days-endpoint (diff) | |
parent | Merge branch 'main' into keeping-tokens-safe (diff) |
Merge pull request #701 from python-discord/keeping-tokens-safe
-rw-r--r-- | pydis_site/apps/content/resources/guides/python-guides/keeping-tokens-safe.md | 29 | ||||
-rw-r--r-- | pydis_site/static/images/content/regenerating_token.jpg | bin | 0 -> 180570 bytes |
2 files changed, 29 insertions, 0 deletions
diff --git a/pydis_site/apps/content/resources/guides/python-guides/keeping-tokens-safe.md b/pydis_site/apps/content/resources/guides/python-guides/keeping-tokens-safe.md new file mode 100644 index 00000000..9d523b4b --- /dev/null +++ b/pydis_site/apps/content/resources/guides/python-guides/keeping-tokens-safe.md @@ -0,0 +1,29 @@ +--- +title: Keeping Discord Bot Tokens Safe +description: How to keep your bot tokens safe and safety measures you can take. +--- +It's **very** important to keep a bot token safe, +primarily because anyone who has the bot token can do whatever they want with the bot -- +such as destroying servers your bot has been added to and getting your bot banned from the API. + +# How to Avoid Leaking your Token +To help prevent leaking your token, +you should ensure that you don't upload it to an open source program/website, +such as replit and github, as they show your code publicly. +The best practice for storing tokens is generally utilising .env files +([click here](https://vcokltfre.dev/tips/tokens/.) for more information on storing tokens safely). + +# What should I do if my token does get leaked? + +If for whatever reason your token gets leaked, you should immediately follow these steps: +- Go to the list of [Discord Bot Applications](https://discord.com/developers/applications) you have and select the bot application that had the token leaked. +- Select the Bot (1) tab on the left-hand side, next to a small image of a puzzle piece. After doing so you should see a small section named TOKEN (under your bot USERNAME and next to his avatar image) +- Press the Regenerate button to regenerate your bot token and invalidate the old one. + + + +Following these steps will create a new token for your bot, making it secure again and terminating any connections from the leaked token. +The old token will stop working though, so make sure to replace the old token with the new one in your code if you haven't already. + +# Summary +Make sure you keep your token secure by storing it safely, not sending it to anyone you don't trust, and regenerating your token if it does get leaked. diff --git a/pydis_site/static/images/content/regenerating_token.jpg b/pydis_site/static/images/content/regenerating_token.jpg Binary files differnew file mode 100644 index 00000000..7b2588dc --- /dev/null +++ b/pydis_site/static/images/content/regenerating_token.jpg |