This is a bot for the promptable.ai Discord server
Relevant code for the /promptable
Discord command can be found in /src/commands/chat/promptable-command.ts
.
- Clone the repo
- Copy .env.example to .env and fill out fields.
- OPENAI_API_KEY can be found here
- Set up your own bot in the Discord Developer Portal for dev purposes and to obtain the rest of the env variables
- DISCORD_CLIENT_ID: General Information -> Application ID
- DISCORD_CLIENT_TOKEN: Bot -> Token
- Install the app onto your own Discord server to test the bot.
- Run the following:
a.
npm install
b.npm run commands:register
c.npm start
- In the discord server where you added the bot, run
/promptable {your prompt}
a. you may need to restart discord if commands don't appear/autocomplete
Note: when adding add new commands, run npm run commands:register
Note: hot-reload is currently not enabled
This bot is deployed using Railway, contact Justin for additional info.
Below contains README info from the Discord bot template that we use. Not all of it is correct since I changed how some of the config files work, please refer to above on how to deploy and work with Promptable Bot.
Discord bot - A discord.js bot template written with TypeScript.
This template was created to give developers a starting point for new Discord bots, so that much of the initial setup can be avoided and developers can instead focus on meaningful bot features. Developers can simply copy this repo, follow the setup instructions below, and have a working bot with many boilerplate features already included!
For help using this template, feel free to join our support server!
- Basic command structure.
- Rate limits and command cooldowns.
- Welcome message when joining a server.
- Shows server count in bot status.
- Posts server count to popular bot list websites.
- Support for multiple languages.
- Written with TypeScript.
- Uses the discord.js framework.
- Built-in debugging setup for VSCode.
- Written with ESM for future compatibility with packages.
- Support for running with the PM2 process manger.
- Support for running with Docker.
- Supports sharding which is required when your bot is in 2500+ servers.
- Supports clustering which allows you to run your bot on multiple machines.
This bot has a few example commands which can be modified as needed.
A /help
command to get help on different areas of the bot or to contact support:
A /info
command to get information about the bot, links to different resources, or developer information.
A generic command, /test
, which can be copied to create additional commands.
A welcome message is sent to the server and owner when the bot is added.
- Copy example config files.
- Navigate to the
config
folder of this project. - Copy all files ending in
.example.json
and remove the.example
from the copied file names.- Ex:
config.example.json
should be copied and renamed asconfig.json
.
- Ex:
- Navigate to the
- Obtain a bot token.
- You'll need to create a new bot in your Discord Developer Portal.
- See here for detailed instructions.
- At the end you should have a bot token.
- You'll need to create a new bot in your Discord Developer Portal.
- Modify the config file.
- Open the
config/config.json
file. - You'll need to edit the following values:
client.id
- Your discord bot's user ID.client.token
- Your discord bot's token.
- Open the
- Install packages.
- Navigate into the downloaded source files and type
npm install
.
- Navigate into the downloaded source files and type
- Register commands.
- In order to use slash commands, they first have to be registered.
- Type
npm run commands:register
to register the bot's commands.- Run this script any time you change a command name, structure, or add/remove commands.
- This is so Discord knows what your commands look like.
- It may take up to an hour for command changes to appear.
You can run the bot in multiple modes:
- Normal Mode
- Type
npm start
. - Starts a single instance of the bot.
- Type
- Manager Mode
- Type
npm run start:manager
. - Starts a shard manager which will spawn multiple bot shards.
- Type
- PM2 Mode
- Type
npm run start:pm2
. - Similar to Manager Mode but uses PM2 to manage processes.
- Type
A list of Discord bots using this template.
Bot | Servers |
---|---|
Birthday Bot | |
QOTD Bot | |
Friend Time | |
Bento | |
NFT-Info | |
Skylink-IF | |
Topcoder TC-101 |
Don't see your bot listed? Contact us to have your bot added!