From 059761fb29aa4b30be21f4a5d79ae0ba4ea339f9 Mon Sep 17 00:00:00 2001 From: wirehack7 Date: Thu, 1 May 2025 14:56:12 +0200 Subject: [PATCH 1/2] translated --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 0e20154..8749a1b 100644 --- a/src/main.py +++ b/src/main.py @@ -166,7 +166,7 @@ async def generate( timeout=120, ) duration = time.monotonic() - start_time - logger.info("Bildgenerierung dauerte %.2f Sekunden", duration) + logger.info("Image creation took %.2f seconds", duration) if response.status_code == 200: response_bytes = response.content -- 2.49.1 From dfaf4ee8f39bbb336d7838678545fad88c70a169 Mon Sep 17 00:00:00 2001 From: wirehack7 Date: Thu, 1 May 2025 15:09:40 +0200 Subject: [PATCH 2/2] added readme --- README.md | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bcce1fb..980c4a5 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,52 @@ -# novelai-bot +# NovelAI Discord Bot +![Code Quality](https://git.0day.agency/wirehack7/novelai-bot/actions/workflows/check-code_quality.yaml/badge.svg) +![Safety Check](https://git.0day.agency/wirehack7/novelai-bot/actions/workflows/check-safety.yaml/badge.svg) +![Release](https://git.0day.agency/wirehack7/novelai-bot/actions/workflows/release.yaml/badge.svg) + +Simple bot which registers a command to generate images via the NovelAI API. + +## Usage + +Just enter `/generate` in the desired channel. + +```text +/generate + *prompt: string + undesired_prompt: string + orientation: landscape or portrait + seed: integer +``` + +`*: required` + +## Run + +You might create environvent vars: + +- **NOVELAI_API_TOKEN**: your NovelAI user API key +- **DISCORD_BOT_TOKEN**: token of your Discord bot +- **DISCORD_CHANNEL_ID**: ID of the channel to enable this bot + +Don't forget to install the requirements in [requirements.txt](src/requirements.txt) + +## Docker Compose + +Or simply run it via **docker-compose**: + +```yaml +services: + bot: + restart: unless-stopped + image: git.0day.agency/wirehack7/novelai-bot:latest + environment: + - NOVELAI_API_TOKEN= + - DISCORD_BOT_TOKEN= + - DISCORD_CHANNEL_ID= +networks: {} +``` + +## Notes + +To create a Discord bot go to [Discord Developers](https://discord.com/developers/). +You should make the bot private. \ No newline at end of file -- 2.49.1