HUB
Sign inSign up

kvllu/imagebot

By kvllu

•Updated over 3 years ago

A simple Discord bot for generating images using OpenAIs DALL·E 2 image generation API.

Image
0

907

kvllu/imagebot repository overview

⁠🧠 ImageBot, a DALL·E 2 Discord Bot

ImageBot is a simple Discord bot for using OpenAi's DALL·E 2⁠ image generation API on Discord servers. It is written in TypeScript using discord.js⁠ and includes unit tests written with Jest⁠.

You can contact me⁠ for a demo of the bot or host it on your own. I am not running the bot publicly as OpenAi's pricing is not cheap.

⁠📝 Requirements

To run the bot you will need:

⁠⚙️ Environment Variables

To run this bot, you need to create an .env file that includes the needed enviroment variables. I have included a template⁠ for this purpose, but heres a quick rundown of the variables:

DISCORD_TOKEN= //Discord token for your bot.
OPENAI_TOKEN= //Token for OpenAi's DALL·E 2 API.
CLIENT_ID= //Client ID of your bot.
GUILD_ID= //Guild ID of a development server, this is used to deploy the commands to only 1 Discord server.

⁠🐬 Running with Docker

Running ImageBot with Docker is very easy, you can do it with my Docker image⁠. Note that you need to provide the environment variables with -e option or use your platform provider's tools to create them.

docker run -d \
    --name imagebot \
    -e DISCORD_TOKEN="discord_token" \
    -e OPENAI_TOKEN="openai_token" \
    -e CLIENT_ID="clientid" \ 
	kvllu/imagebot

(Add -e GUILD_ID if you want to run the bot on 1 Discord server only)

⁠📋 Features and Commands

ImageBot is in early development, it currently has the following:

⁠Generating Images

logo

/image command with options:

  • Description for generating the image(s). ⚠️
  • Resolution of the images to be generated.
  • Number of Images to be generated

Options with ⚠️ are required.

Note: Discord Client ID of the user that executed the command will also be included in the API call to prevent spam and abuse.

Tag summary

Content type

Image

Digest

sha256:10cc442a5…

Size

377 MB

Last updated

over 3 years ago

docker pull kvllu/imagebot