You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Spam bait channel is a separate channel open to all. If anyone sends a message in that channel, can assume account is compromised and a bot is trying to spam messages. Enough warnings in the channel to prevent members from actually sending messages.
22
+
1. Bot token is the discord bot token from the developer token. `str`
23
+
2. Spam bait channel is a separate channel open to all. If anyone sends a message in that channel, can assume account is compromised and a bot is trying to spam messages. Enough warnings in the channel to prevent members from actually sending messages. `int` This feature was added to prevent hacked accounts from spamming messages in the server.
24
+
3. Logs of people banned and messages they sent are sent in this channel. `int`
25
+
4. Current act `int`
26
+
5. DEBUG True or False `bool`. Sets the command prefix to !cyscom-dev to differentiate from production deployement and for testing.
27
+
6. Firebase DB url `str`
28
+
7. Firebase storage url `str`
29
+
8. Root user `int`. Discord user ID (NOT USERNAME) of the account that can trigger adding new members from a google sheet. Typically the person who deployed the bot. For multilple IDs, comma separated.
22
30
23
-
This feature was added to prevent hacked accounts from spamming messages in the server.
31
+
There are no data types in ENV, have to convert everything from str to required type. Types are just mentioned to give approx idea of what kind of values are expected for each key.
24
32
25
-
2. Run using docker
26
-
```{sh}
27
-
docker build -t cyscomvit/discord-bot:latest .
28
-
docker run --detach --name discord-bot-deploy cyscomvit/discord-bot:latest
29
-
```
33
+
### 2. Run using docker
34
+
35
+
```sh
36
+
docker build -t cyscomvit/discord-bot:latest .
37
+
docker run --detach --name discord-bot-deploy cyscomvit/discord-bot:latest
38
+
```
39
+
40
+
# Development
41
+
42
+
The project uses [Poetry](https://python-poetry.org/) to manage dependencies.
43
+
44
+
<details>
45
+
<summary>Why?</summary>
46
+
<br>
47
+
Poetry helps manage virtual environments easily.
48
+
49
+
It also pins versions of both dependencies and their dependencies recursively, unlike Pip. This means every package has an exact version and hash to check and download against.
50
+
51
+
With dependencies like `discord.py`, it became an issue since it's dependencies were not pinned and pip was installing the latest version, leading to many issues.
52
+
<br>
53
+
54
+
</details>
55
+
56
+
1. Download `poetry` using Pip, or by following any of the other methods listed on their [website](https://python-poetry.org/docs/#installation)
57
+
58
+
```sh
59
+
pip install poetry
60
+
```
61
+
62
+
2. Create a virtual env and install all dependencies using poetry.
63
+
64
+
```sh
65
+
poetry install
66
+
```
67
+
68
+
This will create and activate a virtual env. It will also install all dependencies from the poetry.lock file.
69
+
70
+
To add new dependencies:
71
+
72
+
```sh
73
+
poetry add package-name
74
+
```
75
+
76
+
Update it in the `requirements.txt` (**USING POETRY COMMANDS, DON'T EDIT IT MANUALLY**) file too. Even though we use poetry, having a usable requirements.txt file might be convient for others. It is also used to build the docker image, since having poetry installed makes the image larger (smaller image better). Since the requirements.txt file is kept up-to-date, the image can use `pip` to install it, without ever downloading or installing poetry.
**MAKE SURE YOU ADD DEPENDENCIES USING POETRY FIRST, AND DO NOT USE PIP TO INSTALL ANY PACKAGE FOR THIS PROJECT**. This ensures the package's dependencies are also pinned in the `poetry.lock` file as well.
f"The following required environmental variables have not been set - {(xforxinrequired_env_variablesifxnotinenviron)}"
32
+
f"The following required environmental variables have not been set - {(xforxinrequired_env_variablesifxnotinenviron)}. Refer to code and Readme.MD for seeing what env keys are needed"
0 commit comments