Update to main

This commit is contained in:
Die Antwoord 2023-01-23 16:03:21 +02:00
parent 3e1524ee8c
commit a39f00a2a6
3 changed files with 24 additions and 5 deletions

3
.env Normal file
View File

@ -0,0 +1,3 @@
TOKEN=
WEBHOOK=
TOMORROWIO_TOKEN=

3
env_demo.env Normal file
View File

@ -0,0 +1,3 @@
TOKEN=YOUR_BOT_TOKEN_HERE
WEBHOOK=YOUR_WEBHOOK_HERE
TOMORROWIO_TOKEN=WEATHER_API_TOKEN

View File

@ -14,7 +14,23 @@ $ cd ./Discord-Bot-Python
- Permission Generator: [HERE](https://discordapi.com/permissions.html) - Permission Generator: [HERE](https://discordapi.com/permissions.html)
- Invite Your Bot: <https://discord.com/oauth2/authorize?&client_id=YOUR_APPLICATION_ID_HERE&scope=bot+applications.commands&permissions=8> - Invite Your Bot: <https://discord.com/oauth2/authorize?&client_id=YOUR_APPLICATION_ID_HERE&scope=bot+applications.commands&permissions=8>
## Create config.json & .env
## Create .env enviroment
- NOTE: If you going to use .env environment you will need to make the necessary changes to the bots code inorder for it to work
- Create [.env](.env) file in the root director.
- Here is an explanation of what the values should look like: [env_demo](env_demo)
[env_demo](env_demo)
```env
TOKEN=YOUR_BOT_TOKEN_HERE
WEBHOOK=YOUR_WEBHOOK_HERE
TOMORROWIO_TOKEN=WEATHER_API_TOKEN
```
https://dev.to/jakewitcher/using-env-files-for-environment-variables-in-python-applications-55a1
## Create config.json
- Create [config.json](config.json) file in the root directory. - Create [config.json](config.json) file in the root directory.
- Here is an explanation of what the values should look like: [demo.config.json](demo.config.json) - Here is an explanation of what the values should look like: [demo.config.json](demo.config.json)
@ -48,7 +64,7 @@ $ cd ./Discord-Bot-Python
- RUN in Command-Promt [Windows key + r , input ``cmd`` and press enter] - RUN in Command-Promt [Windows key + r , input ``cmd`` and press enter]
```shell ```choc
$ pip install -r requirements.txt $ pip install -r requirements.txt
``` ```
@ -59,18 +75,15 @@ $ pip install -r requirements.txt
```shell ```shell
$ python bot.py $ python bot.py
``` ```
- If you have multiple versions of python installed (2.x and 3.x) then you will need to use the following command: - If you have multiple versions of python installed (2.x and 3.x) then you will need to use the following command:
```shell ```shell
$ python3 bot.py $ python3 bot.py
``` ```
- or eventually - or eventually
```shell ```shell
$ python3.x bot.py $ python3.x bot.py
``` ```
- Replace `x` with the version of Python you have installed. - Replace `x` with the version of Python you have installed.