Skip to content

Commit 9a56aff

Browse files
author
Suguru Hirahara
committed
Edit docs for bots: adopt the common format
- Add "To use the bot" if it does not exist: adopt the format of the docs for bridges - Add "Prerequisites" section if an API key or user account is required - Use the common instruction for getting an access token - Replace "Get" with "Obtain" about getting keys or access tokens - Replace placeholders for access tokens on docs/configuring-playbook-bot-go.neb.md Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org>
1 parent 2337e62 commit 9a56aff

13 files changed

+40
-41
lines changed

docs/configuring-playbook-alertmanager-receiver.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ You can use the playbook to [register a new user](registering-users.md):
2222
ansible-playbook -i inventory/hosts setup.yml --extra-vars='username=bot.alertmanager.receiver password=PASSWORD_FOR_THE_BOT admin=no' --tags=register-user
2323
```
2424

25-
### Get an access token
25+
### Obtain an access token
2626

2727
The bot requires an access token to be able to connect to your homeserver. Refer to the documentation on [how to obtain an access token](obtaining-access-tokens.md).
2828

@@ -36,15 +36,14 @@ Then, log in as the bot using any Matrix client of your choosing, accept the roo
3636

3737
## Adjusting the playbook configuration
3838

39-
Add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file. Make sure to replace `ACCESS_TOKEN_HERE` with the one created [above](#get-an-access-token).
39+
Add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file. Make sure to replace `ACCESS_TOKEN_HERE` with the one created [above](#obtain-an-access-token).
4040

4141
```yaml
4242
matrix_alertmanager_receiver_enabled: true
4343

4444
# Uncomment and adjust this part if you'd like to use a username different than the default
4545
# matrix_alertmanager_receiver_config_matrix_user_id_localpart: "bot.alertmanager.receiver"
4646

47-
# Specify the bot user's access token here.
4847
matrix_alertmanager_receiver_config_matrix_access_token: "ACCESS_TOKEN_HERE"
4948

5049
# Optionally, configure some mappings (URL-friendly room name -> actual Matrix room ID).

docs/configuring-playbook-bot-baibot.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Depending on your current `vars.yml` file and desired configuration, **you may r
3030

3131
### Base configuration
3232

33-
Add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file:
33+
To enable the bot, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file:
3434

3535
```yaml
3636
matrix_bot_baibot_enabled: true

docs/configuring-playbook-bot-buscarron.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Buscarron is bot that receives HTTP POST submissions of web forms and forwards t
66

77
## Adjusting the playbook configuration
88

9-
To enable Buscarron, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file:
9+
To enable the bot, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file:
1010

1111
```yaml
1212
matrix_bot_buscarron_enabled: true

docs/configuring-playbook-bot-chatgpt.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ The playbook can install and configure [matrix-chatgpt-bot](https://github.com/m
66

77
Talk to [ChatGPT](https://openai.com/blog/chatgpt/) via your favourite Matrix client!
88

9-
## Register the bot account
9+
## Prerequisites
1010

11-
The playbook does not automatically create users for you. The bot requires an access token to be able to connect to your homeserver.
11+
### Obtain an OpenAI API key
1212

13-
You **need to register the bot user manually** before setting up the bot.
13+
To use the bot, you'd need to obtain an API key from [https://platform.openai.com/account/api-keys](https://platform.openai.com/account/api-keys).
14+
15+
### Register the bot account
16+
17+
The playbook does not automatically create users for you. You **need to register the bot user manually** before setting up the bot.
1418

1519
Generate a strong password for the bot. You can create one with a command like `pwgen -s 64 1`.
1620

@@ -20,37 +24,31 @@ You can use the playbook to [register a new user](registering-users.md):
2024
ansible-playbook -i inventory/hosts setup.yml --extra-vars='username=bot.chatgpt password=PASSWORD_FOR_THE_BOT admin=no' --tags=register-user
2125
```
2226

23-
## Get an access token and create encryption keys
27+
### Obtain an access token and create encryption keys
2428

25-
Refer to the documentation on [how to obtain an access token](obtaining-access-tokens.md).
29+
The bot requires an access token to be able to connect to your homeserver. Refer to the documentation on [how to obtain an access token](obtaining-access-tokens.md).
2630

2731
To make sure the bot can read encrypted messages, it will need an encryption key, just like any other new user. While obtaining the access token, follow the prompts to setup a backup key. More information can be found in the [Element documentation](https://element.io/help#encryption6).
2832

2933
## Adjusting the playbook configuration
3034

31-
Add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file (adapt to your needs):
35+
To enable the bot, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file. Make sure to replace `API_KEY_HERE` with the API key retrieved [here](#obtain-an-openai-api-key) and `ACCESS_TOKEN_HERE` with the access token created [here](#obtain-an-access-token-and-create-encryption-keys), respectively.
3236

3337
```yaml
3438
matrix_bot_chatgpt_enabled: true
3539

36-
# Obtain a new API key from https://platform.openai.com/account/api-keys
37-
matrix_bot_chatgpt_openai_api_key: ''
40+
matrix_bot_chatgpt_openai_api_key: 'API_KEY_HERE'
3841

39-
# This is the default username
42+
# Uncomment and adjust this part if you'd like to use a username different than the default
4043
# matrix_bot_chatgpt_matrix_bot_username_localpart: 'bot.chatgpt'
4144

42-
# Matrix access token (from bot user above)
43-
# see: https://webapps.stackexchange.com/questions/131056/how-to-get-an-access-token-for-element-riot-matrix
44-
matrix_bot_chatgpt_matrix_access_token: ''
45+
matrix_bot_chatgpt_matrix_access_token: 'ACCESS_TOKEN_HERE'
4546

4647
# Configuring the system promt used, needed if the bot is used for special tasks.
4748
# More information: https://github.com/mustvlad/ChatGPT-System-Prompts
4849
matrix_bot_chatgpt_matrix_bot_prompt_prefix: 'Instructions:\nYou are ChatGPT, a large language model trained by OpenAI.'
49-
5050
```
5151
52-
You will need to get tokens for ChatGPT.
53-
5452
## Installing
5553
5654
After configuring the playbook, run it with [playbook tags](playbook-tags.md) as below:

docs/configuring-playbook-bot-draupnir.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ ansible-playbook -i inventory/hosts setup.yml --extra-vars='username=bot.draupni
2424

2525
If you would like Draupnir to be able to deactivate users, move aliases, shutdown rooms, show abuse reports (see [below](#abuse-reports)), etc then it must be a server admin so you need to change `admin=no` to `admin=yes` in the command above.
2626

27-
### Get an access token
27+
### Obtain an access token
2828

2929
The bot requires an access token to be able to connect to your homeserver. Refer to the documentation on [how to obtain an access token](obtaining-access-tokens.md).
3030

@@ -64,7 +64,7 @@ Finally invite the `@bot.draupnir:example.com` account you created earlier into
6464

6565
## Adjusting the playbook configuration
6666

67-
Add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file. Make sure to replace `MANAGEMENT_ROOM_ID_HERE`.
67+
To enable the bot, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file. Make sure to replace `MANAGEMENT_ROOM_ID_HERE`.
6868

6969
```yaml
7070
# Enable Draupnir
@@ -113,7 +113,7 @@ matrix_bot_draupnir_raw_homeserver_url: "{{ matrix_addons_homeserver_client_api_
113113

114114
When NOT using Pantalaimon, Draupnir does not log in by itself and you must give it an access token for its bot account.
115115

116-
Add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file. Make sure to replace `ACCESS_TOKEN_HERE` with the one created [above](#get-an-access-token).
116+
Add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file. Make sure to replace `ACCESS_TOKEN_HERE` with the one created [above](#obtain-an-access-token).
117117

118118
```yaml
119119
matrix_bot_draupnir_access_token: "ACCESS_TOKEN_HERE"

docs/configuring-playbook-bot-go-neb.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ Go-NEB is a Matrix bot written in Go. It is the successor to Matrix-NEB, the ori
88

99
See the project's [documentation](https://github.com/matrix-org/go-neb/blob/master/README.md) to learn what it does and why it might be useful to you.
1010

11-
## Registering the bot account
11+
## Prerequisites
1212

13-
The playbook does not automatically create users for you. The bot requires at least 1 access token to be able to connect to your homeserver.
13+
### Register the bot account
1414

15-
You **need to register the bot user manually** before setting up the bot.
15+
The playbook does not automatically create users for you. You **need to register the bot user manually** before setting up the bot.
1616

1717
Generate a strong password for the bot. You can create one with a command like `pwgen -s 64 1`.
1818

@@ -22,11 +22,13 @@ You can use the playbook to [register a new user](registering-users.md):
2222
ansible-playbook -i inventory/hosts setup.yml --extra-vars='username=bot.go-neb password=PASSWORD_FOR_THE_BOT admin=no' --tags=register-user
2323
```
2424

25-
Once the user is created you can [obtain an access token](obtaining-access-tokens.md).
25+
### Obtain an access token
26+
27+
The bot requires an access token to be able to connect to your homeserver. Refer to the documentation on [how to obtain an access token](obtaining-access-tokens.md).
2628

2729
## Adjusting the playbook configuration
2830

29-
To enable Go-NEB, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file:
31+
To enable the bot, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file. Make sure to replace `ACCESS_TOKEN_FOR_GONEB_HERE` and `ACCESS_TOKEN_FOR_ANOTHER_GONEB_HERE` with the ones created [above](#obtain-an-access-token).
3032

3133
```yaml
3234
matrix_bot_go_neb_enabled: true
@@ -35,7 +37,7 @@ matrix_bot_go_neb_enabled: true
3537
# Use the access token you obtained in the step above.
3638
matrix_bot_go_neb_clients:
3739
- UserID: "@goneb:{{ matrix_domain }}"
38-
AccessToken: "MDASDASJDIASDJASDAFGFRGER"
40+
AccessToken: "ACCESS_TOKEN_FOR_GONEB_HERE"
3941
DeviceID: "DEVICE1"
4042
HomeserverURL: "{{ matrix_addons_homeserver_client_api_url }}"
4143
Sync: true
@@ -44,7 +46,7 @@ matrix_bot_go_neb_clients:
4446
AcceptVerificationFromUsers: [":{{ matrix_domain }}"]
4547

4648
- UserID: "@another_goneb:{{ matrix_domain }}"
47-
AccessToken: "MDASDASJDIASDJASDAFGFRGER"
49+
AccessToken: "ACCESS_TOKEN_FOR_ANOTHER_GONEB_HERE"
4850
DeviceID: "DEVICE2"
4951
HomeserverURL: "{{ matrix_addons_homeserver_client_api_url }}"
5052
Sync: false
@@ -105,7 +107,7 @@ matrix_bot_go_neb_services:
105107
api_key: "AIzaSyA4FD39m9"
106108
cx: "AIASDFWSRRtrtr"
107109

108-
# Get a key via https://api.imgur.com/oauth2/addclient
110+
# Obtain a key via https://api.imgur.com/oauth2/addclient
109111
# Select "oauth2 without callback url"
110112
- ID: "imgur_service"
111113
Type: "imgur"

docs/configuring-playbook-bot-honoroit.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ See the project's [documentation](https://github.com/etkecc/honoroit/blob/main/R
88

99
## Adjusting the playbook configuration
1010

11-
To enable Honoroit, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file:
11+
To enable the bot, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file:
1212

1313
```yaml
1414
matrix_bot_honoroit_enabled: true

docs/configuring-playbook-bot-matrix-registration-bot.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The bot allows you to easily **create and manage registration tokens** aka. invi
66

77
See the project's [documentation](https://github.com/moan0s/matrix-registration-bot/blob/master/README.md) to learn what it does and why it might be useful to you.
88

9-
## Configuration
9+
## Adjusting the playbook configuration
1010

1111
To enable the bot, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file:
1212

docs/configuring-playbook-bot-matrix-reminder-bot.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ See the project's [documentation](https://github.com/anoadragon453/matrix-remind
88

99
## Adjusting the playbook configuration
1010

11-
Add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file:
11+
To enable the bot, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file:
1212

1313
```yaml
1414
matrix_bot_matrix_reminder_bot_enabled: true

docs/configuring-playbook-bot-maubot.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ See the project's [documentation](https://docs.mau.fi/maubot/usage/basic.html) t
88

99
## Adjusting the playbook configuration
1010

11-
To enable maubot, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file:
11+
To enable the bot, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file:
1212

1313
```yaml
1414
matrix_bot_maubot_enabled: true
@@ -75,7 +75,7 @@ You should start in the following order
7575
2. **Upload some Plugins**: Plugins can be obtained from [here](https://github.com/maubot/maubot#plugins) or any other source.
7676
3. **Create an instance**: An instance is the actual bot. You have to specify a client which the bot instance will use and the plugin (how the bot will behave)
7777

78-
## Obtaining an access token
78+
## Obtain an access token
7979

8080
This can be done via `mbc login` then `mbc auth` (see the [maubot documentation](https://docs.mau.fi/maubot/usage/cli/auth.html)). To run these commands, you'll first need to `exec` into the maubot container with `docker exec -it matrix-bot-maubot sh`.
8181

0 commit comments

Comments
 (0)