Skip to content

Commit

Permalink
Merge pull request #28 from rlywtf/daemon_documenation
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
johndotpub authored Jan 8, 2024
2 parents abb8527 + d162d48 commit 7ef6121
Showing 1 changed file with 34 additions and 3 deletions.
37 changes: 34 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ This is a Python script for a Discord bot that uses OpenAI's GPT API to generate

# Requirements

- Python 3.6 or higher
- discord.py
- openai
- Bash
- Python 3.6 or Higher
- Python Modules
- discord.py
- openai

# Installation

Expand Down Expand Up @@ -92,6 +94,35 @@ python bot.py --conf config.ini

The bot will log in to Discord and start listening for messages in the configured channels. When a message is received, the bot will send the message to the OpenAI API and wait for a response. The response will be sent back to the user who sent the message.

# Daemon Control Script

`discordian.sh` is a bash script for launching a DiscordianAI bot with customizable configurations. It is suitable for both manual execution and running via crontab.

### Features

- Strict error checking: The script exits on any error and recognizes failures in pipelines.
- Logging: The script logs events with timestamps for better tracking.
- Customizable configurations: The script allows for different modes of operation and configurations.
- Error Handling: It logs errors and exits on failure.
- Process Handling: It terminates existing instances of the bot before starting a new one.

### Usage

The script accepts the following command line arguments:

- `-d` or `--daemon`: Runs the bot in daemon mode with no output to the terminal.
- `-b` or `--background`: Runs the bot in background mode with output redirected to `nohup.out`.
- `-c` or `--config`: Allows the use of a custom configuration file. The next argument should be the path to the configuration file.
- `-f` or `--folder`: Allows the use of a base folder. The next argument should be the path to the base folder.

### Daemon Example

```bash
./discordian.sh -d -c /path/to/config.ini -f /path/to/base/folder
```

This command will run the bot in daemon mode, using the configuration file at `/path/to/config.ini` and the base folder at `/path/to/base/folder`.

# Contributing

Contributions are welcome! Please open an issue or pull request on the GitHub repository.
Expand Down

0 comments on commit 7ef6121

Please sign in to comment.