-
Download
git clone https://github.com/Wischnat/Auto-Midjourney-Discord-Bot.git
-
Install dependencies
npm i
-
Create in a .env file in the root of your project
-
Insert your key/value pairs
MY_BOT_DISCORD_TOKEN
: Available after creating the discord botMY_BOT_APPLICATION_ID
: Available after creating the discord botAUTHORIZATION
:- Open Discord in your browser
- Open
DevTools
(ctrl + shift + i) - Click
"Network"
from the toolbar at the top - Reload the page
(F5)
- Type
"/api"
in the filter - Click on the
"library" request
- Click the
"Headers"
tab and search for"authorization"
- Copy and paste this to
AUTHORIZATION
OPENAI_API_KEY
:- Go to OpenAI API keys
- Click
"Create new secret key"
and give your key a name. - Copy your token and past this to
"OPENAI_API_KEY"
ERROR_CHANNEL_ID
: Available after creating the discord serverMY_BOT_DISCORD_TOKEN= MY_BOT_APPLICATION_ID= AUTHORIZATION= OPENAI_API_KEY= ERROR_CHANNEL_ID=
- Create a new Discord Server
- Click on
"Advanced"
in yourDiscord Settings
and enable"Developer Mode"
. - Click the
"+" button
on the left hand column - Click
"Create My Own"
- Name your server and click "Create"
- Create a new channel
(error channel)
- Right click on your new channel and click
"Copy Channel ID"
- Paste the channel id in your
".env"
under"ERROR_CHANNEL_ID"
.
- Click on
- Create a new Discord Bot
- Go to Developer Portal Applications
- Click on
"New Application"
- Give your bot a name and then click on
“Create”
. - Go to
"General Information"
and copy the"APPLICATION ID"
then past this in your".env"
under"MY_BOT_APPLICATION_ID"
. - Go to
"Bot"
and click on"Reset Token"
. Then copy yourBot Token
and C - Go to
"OAuth2 URL Generator"
and in the field"SCOPES"
check the box"bot"
. - In the field
"BOT PERMISSIONS"
check the boxes"Read Messages/View Channels", "Send Messages", "Manage Messages", "Use Slash Commands", "Read Message History"
. - Copy the generated url and add your bot to your server.
The configurations can be changed using Slash Commands.
{
"midjourney": {
"limit": 200
},
"gpt": {
"model": "text-davinci-003",
"maxTokens": 4000,
"temperature": 1,
"topP": 1,
"frequencyPenalty": 0,
"presencePenalty": 0,
"promptRole": "Assume the role of a midjourney (image creation) prompt creator.",
"maxPrompts": 2,
"promptTopics": "Nature, Night, lake,"
}