This bot automatically responds to messages in SOGS. It works using SOGS REST API.
- Clone this repository to your server (not necessarily the one you're hosting SOGS on):
git clone https://github.com/VityaSchel/session-sogs-bot-autoreply.git
(installgit
if it's not installed on your OS) - Go to cloned directory
- Install Bun using command on bun.sh
- Install dependencies using
bun install
command - Generate random mnemonic:
bun generate-mnemonic.ts
(skip this step if you already have one) - Copy config:
cp config.example.json config.json
- Edit config:
nano config.json
- Start bot:
bun index.ts
Protocol + host to access sogs. Can be localhost and external.
Examples:
http://localhost:3000
https://sogs.hloth.dev
64 hex characters you can find in SOGS url after ?public_key=
Token of room. Think of this as an ID. You can find room's token in URL to sogs. For example:
There bunsogs
is room token
Paste generated mnemonic from step 5 or some other mnemonic
Displayed name of your bot, max. 64 characters
Enable (recommended) if you want your bot to have 15 prefix instead of 05. Session will eventually stop supporting unblinded SOGS, so I recommend settings this to true
Array of triggers and responses.
Example:
"responses": [
{
"triggers": ["!test", "!foobar"],
"response": "Test response"
},
{
"triggers": ["!author"],
"response": "hloth.dev"
}
]
Do not add or edit this to config if you're unsure how it works. This is sequence number (i.e. last message id that bot was on)
First time you run the bot, it will automatically pick up latest message and its id add to config for future reference.