Fix some problems in the Handling-Bot-Tokens.md
Just some minor changes and typo fixes
This commit is contained in:
parent
6ce7eb1323
commit
99899f1bd3
@ -1,10 +1,10 @@
|
|||||||
* [Bot Token Dont's](#bot-token-donts)
|
* [Bot Token Rules](#bot-token-rules)
|
||||||
* [Using Enviroment Variables](#using-environment-variables)
|
* [Using Enviroment Variables](#using-environment-variables)
|
||||||
* [Setting Enviroment Variables](#setting-environment-variables)
|
* [Setting Enviroment Variables](#setting-environment-variables)
|
||||||
* [Accessing Enviroment Variables](#accessing-enviroment-variables)
|
* [Accessing Enviroment Variables](#accessing-enviroment-variables)
|
||||||
* [Using Command Line Arguments](#using-command-line-arguments)
|
* [Using Command Line Arguments](#using-command-line-arguments)
|
||||||
|
|
||||||
# <a id="bot-token-donts"></a> Bot Token Dont's ##
|
# <a id="bot-token-rules"></a> Bot Token Rules ##
|
||||||
* Tokens should not be hardcoded into the bot code
|
* Tokens should not be hardcoded into the bot code
|
||||||
* Tokens should never be published
|
* Tokens should never be published
|
||||||
* Tokens should not be pushed into Repositorys
|
* Tokens should not be pushed into Repositorys
|
||||||
@ -36,7 +36,7 @@ It can also be set using the Windows GUI
|
|||||||
export VARIABLE_NAME = {YOUR_BOT_TOKEN}
|
export VARIABLE_NAME = {YOUR_BOT_TOKEN}
|
||||||
```
|
```
|
||||||
* Save the file
|
* Save the file
|
||||||
* Either reboot your system or run the command above in your terminal
|
* Either start a new terminal or run the command above
|
||||||
|
|
||||||
### IntelliJ
|
### IntelliJ
|
||||||
* Go to Run->Edit Configuratuions...
|
* Go to Run->Edit Configuratuions...
|
||||||
@ -65,7 +65,7 @@ String BOT_TOKEN = System.getenv("VARIABLE_NAME");
|
|||||||
In Spring the @Value annotation allows you to inject the Value into your class
|
In Spring the @Value annotation allows you to inject the Value into your class
|
||||||
```java
|
```java
|
||||||
public class Bot extends TelegramLongPollingBot {
|
public class Bot extends TelegramLongPollingBot {
|
||||||
public Bot(@Value("${VARIABLE_NAME") String botToken) {
|
public Bot(@Value("${VARIABLE_NAME}") String botToken) {
|
||||||
this.botToken = botToken;
|
this.botToken = botToken;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user