Skip to content

A Discord Bot application that connects to OpenAI Dall-E Image Generation and Vision APIs

Notifications You must be signed in to change notification settings

dewmguy/dallegpt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DALL·E Bot Description and Usage

Description

This app leverages the Discord.js library, OpenAI's API, and Axios for HTTP requests to create a Discord bot that can generate images based on user prompts or analyze images using OpenAI's DALL·E and GPT-4 models. The bot can interact with messages in a Discord server to provide real-time image generation or image analysis, making it a versatile tool for creative and analytical purposes within Discord communities.

How to Use

  1. Starting the Bot:

    • Ensure all necessary dependencies are installed by running npm install openai discord.js dotenv axios
    • Start the bot with node index.js (assuming your main file is named index.js).
    • Recommend using tmux to keep the bot running in the background
  2. Interacting with the Bot:

    • The bot listens for direct mentions in a Discord server.
    • Users can send text prompts for image generation or attach images for analysis.
    • For image generation, the bot uses the prompt to create an image using OpenAI's DALL·E model.
    • For image analysis, the bot processes the attached image and provides insights based on the content using GPT-4.
  3. Handling Responses:

    • The bot handles both text and image outputs, depending on the user interaction.
    • It provides feedback on the process duration and optimizes the image generation prompts to enhance results.
    • Errors are managed gracefully, informing users of issues to maintain engagement.

Environment Variables

The bot requires the following environment variables to operate correctly:

  • DISCORD_TOKEN: Token used to authenticate with Discord and enable bot interactions.
  • OPENAI_APIKEY: Key required to authenticate requests to OpenAI's API for accessing models like DALL·E and GPT-4.

Additional Notes

  • Keep all sensitive information, like tokens and keys, secure and out of your source code.
  • The bot’s features can be expanded or adjusted according to specific needs or to incorporate additional functionalities from Discord and OpenAI.

This README provides a detailed guide for setting up, using, and understanding the bot's capabilities within a Discord environment. For further customization or troubleshooting, consult the documentation for each integrated service.

About

A Discord Bot application that connects to OpenAI Dall-E Image Generation and Vision APIs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published