- TypeScript 87.5%
- JavaScript 12.5%
| .vscode | ||
| .gitignore | ||
| .prettierrc.js | ||
| bun.lockb | ||
| config.example.json | ||
| eslint.config.js | ||
| generate-mnemonic.ts | ||
| index.ts | ||
| LICENSE.md | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
session-sogs-bot-autoreply
This bot automatically responds to messages in SOGS. It works using SOGS REST API.
Installation
- 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(installgitif it's not installed on your OS) - Go to cloned directory
- Install Bun using command on bun.sh
- Install dependencies using
bun installcommand - 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
Config
sogsUrl
Protocol + host to access sogs. Can be localhost and external.
Examples:
http://localhost:3000https://sogs.hloth.dev
sogsPublicKey
64 hex characters you can find in SOGS url after ?public_key=
roomToken
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
mnemonic
Paste generated mnemonic from step 5 or some other mnemonic
botDisplayName
Displayed name of your bot, max. 64 characters
blinding
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
responses
Array of triggers and responses.
Example:
"responses": [
{
"triggers": ["!test", "!foobar"],
"response": "Test response"
},
{
"triggers": ["!author"],
"response": "hloth.dev"
}
]
lastSeqNo (optional)
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.