Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jmhayes3/binks.js
AI assistant and chatbot for Discord that leverages the OpenAI Assistants API.
https://github.com/jmhayes3/binks.js
ai-assistant discord-app discord-bot discord-js nodejs openai-api openai-assistants-api
Last synced: about 23 hours ago
JSON representation
AI assistant and chatbot for Discord that leverages the OpenAI Assistants API.
- Host: GitHub
- URL: https://github.com/jmhayes3/binks.js
- Owner: jmhayes3
- License: mit
- Created: 2024-07-31T05:14:18.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2024-09-05T05:56:12.000Z (21 days ago)
- Last Synced: 2024-09-20T04:20:31.711Z (6 days ago)
- Topics: ai-assistant, discord-app, discord-bot, discord-js, nodejs, openai-api, openai-assistants-api
- Language: JavaScript
- Homepage: https://jmhayes3.github.io/binks.js/
- Size: 2.72 MB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# binks.js
binks.js is a chatbot that integrates Discord.js with the new OpenAI Assistants API.
The bot operates within Discord channels, listening to messages and using the Assistants API to generate responses.## Features
- **Discord Integration**: The bot listens to messages in Discord channels.
- **OpenAI Response Generation**: Leverages the new OpenAI Assistants API to create responses to messages.
- **Message Thread Tracking**: Maintains message threads for continuity in conversations.
- **Assistants Capabilities**: Since the bot uses Assistants, you no longer have to worry about context management and you can also benefit from assistant capabilities such as `code interpreter` and `file search`## Prerequisites
- Node.js installed on your machine.
- A Discord bot token (from Discord Developer Portal).
- An OpenAI API key.## Installation
1. **Clone the Repository**:
```
git clone https://github.com/jmhayes3/binks.js.git
```
2. **Navigate to the Repository Folder**:
```
cd binks.js
```
3. **Install Dependencies**:
```
npm install
```## Configuration
1. **Set Up Environment Variables**:
Create a `.env` file in the root of your project with the following variables:
```
DISCORD_TOKEN=your_discord_bot_token
OPENAI_API_KEY=your_openai_api_key
ASSISTANT_ID=your_openai_assistant_id
```## Running the Bot
1. **Start the Bot**:
```
node app.js
```## Usage
- **Interaction**: Simply type `/chat` and then your message to interact with the bot. The bot will automatically generate and send replies based on the OpenAI assistant's output.
- **Discord Channels**: Works in any text channel or thread where the bot has permissions to read and send messages.## Contributing
Feel free to fork the repository and submit pull requests.