configuration file

This commit is contained in:
array-in-a-matrix 2022-08-16 00:39:40 -04:00
parent c40df8e1e9
commit 31688c2dba
2 changed files with 25 additions and 3 deletions

View File

@ -4,7 +4,7 @@ Matrix bot that generates messages based off of messages of other users using a
## Usage
First install the needed [libraries](#setup). Then copy `example.config.json` and rename it `config.json`. Replace the items in angled brackets with their respective values of the bot account (e.g. replace `<DOMAIN.TLD>` with the homeserver url like `https://matrix.org` or `https://matrix.arrayinamatrix.xyz`). You can follow the instructions [here](https://matrix.org/docs/guides/usage-of-matrix-bot-sdk#instantiation) to obtain the token of an account.
First install the needed [libraries](#setup). Then copy `example.config.json` and rename it `config.json`. Replace the items in angled brackets with their respective values of the bot account (e.g. replace `<DOMAIN.TLD>` with the homeserver url like `https://matrix.org` or `https://matrix.arrayinamatrix.xyz`). An explanation of each configurable string is located in [configurations](#configurations) section of this document. To obtain the token of an account follow the instructions [here](https://matrix.org/docs/guides/usage-of-matrix-bot-sdk#instantiation).
Once the config file has been populated with valid data, execute the `index.js` file (Warning: executing for the first time will be slow.).
@ -32,3 +32,23 @@ Install Python module:
```sh
> pip3 install aitextgen
```
## Configurations
Before a bot can be used the fields in the `config.json` file must be populated with valid information. Values in angled brackets (are stared below) must be supplied before usage.
```json
► homeserver* ⇢ URL of the bot's homeserver.
► token* ⇢ Account token used to sign in the bot.
► user* ⇢ Account's User ID.
► file ⇢ Path of file used for training the AI.
► prefix ⇢ Bot listens to commands that start with this prefix.
► frequency ⇢ How often the bot sends a message (keep low to prevent spam).
► size ⇢ Bot starts generating messages when the number of lines in the training file is equal to this. The greater the size, the longer bot waits before messaging but might increase message quality.
```

View File

@ -2,6 +2,8 @@
"homeserver": "<DOMAIN.TLD>",
"token": "<TOKEN>",
"user": "@<USER>:<DOMAIN.TLD>",
"file": "<PATH>",
"prefix": "!"
"file": "training-matrix.txt",
"prefix": "!",
"frequency": "25",
"size": "5000"
}