47 lines
1.9 KiB
Markdown
47 lines
1.9 KiB
Markdown
# Nyx the Bot
|
|
Fork of Eris the Bot https://eris.lisq.eu
|
|
|
|
Telegram bot for generating images from text.
|
|
|
|
## Requirements
|
|
|
|
- [Deno](https://deno.land/) (for the bot server)
|
|
- [Stable Diffusion WebUI](https://github.com/AUTOMATIC1111/stable-diffusion-webui/) (for the worker that generates images)
|
|
|
|
## Options
|
|
|
|
You can put these in `.env` file or pass them as environment variables.
|
|
|
|
- `TG_BOT_TOKEN` - Telegram bot token. Get yours from [@BotFather](https://t.me/BotFather).
|
|
Required.
|
|
- `DENO_KV_PATH` - [Deno KV](https://deno.land/api?s=Deno.openKv&unstable) database file path. A
|
|
temporary file is used by default. Example: /opt/data/botdata.kv
|
|
- `LOG_LEVEL` - [Log level](https://deno.land/std@0.201.0/log/mod.ts?s=LogLevels). Default: `INFO`.
|
|
|
|
## Running
|
|
|
|
1. Start Eris: `deno task start`
|
|
2. Visit [Eris WebUI](http://localhost:8443/) and login via Telegram.
|
|
3. Promote yourself to admin in the Eris WebUI.
|
|
4. Start Stable Diffusion WebUI: `./webui.sh --api` (in SD WebUI directory)
|
|
5. Add a new worker in the Eris WebUI.
|
|
|
|
## This fork requires the use of webhooks.
|
|
|
|
1. You need a reverse Proxy and HTTPS certificate set up that proxies all requests from a domain on port 443 (e.g. nyx.akiru.de) to the backend of this bot (:8443).
|
|
2. Change the Webhook URL to your own one in /mod/bot.ts - There are also console log statements you can uncomment for troubleshooting.
|
|
3. Make sure the DNS and firewall are set up for the webhook to be reachable, because otherwise the bot fails to start.
|
|
|
|
## Codegen
|
|
|
|
The Stable Diffusion API types are auto-generated. To regenerate them, first start your SD WebUI
|
|
with `--nowebui --api`, and then run `deno task generate`
|
|
|
|
## Project structure
|
|
|
|
- `/api` - Eris API served at `http://localhost:8443/api/`.
|
|
- `/app` - Queue handling and other core processes.
|
|
- `/bot` - Handling bot commands and other updates from Telegram API.
|
|
- `/ui` - Eris WebUI frontend files served at `http://localhost:8443/`.
|
|
- `/util` - Utility functions shared by other parts.
|