This project is a Discord bot that integrates with an external API to provide answers to user questions and fetch user information.
For better service, please visit https://openonion.ai. you can install the bot using link https://discord.com/oauth2/authorize?client_id=1274612373340164107
- Automatically detects and responds to user questions in Discord channels.
- Fetches and logs user information from an external API.
- Python 3.7+
- A Discord bot token
- An API URL and token
-
Clone the repository:
git clone https://github.com/openonion/OnionPal.git cd OnionPal -
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Create a
.envfile in the root directory of the project and add your configuration variables:DISCORD_TOKEN=your_discord_token API_URL=https://api.trustonion.com API_TOKEN=Your account token for openonion
-
Start the bot:
python bot.py
bot.py: Main bot file that handles Discord events and commands.api_client.py: Contains functions to interact with the external API.config.py: Loads environment variables from the.envfile.question_detector.py: Contains logic to detect if a message is a question.requirements.txt: Lists the dependencies required for the project.
- The bot automatically detects and responds to messages that are questions.
- Use the
!askcommand followed by your question to get an answer from the bot.