Welcome to the Erry Bot Handler repository! This robust handler is designed to streamline your Discord bot development using the latest features of Discord.js v14 with TypeScript. This handler will be used for Erry bot.
- TypeScript Ready: Crafted for the modern TypeScript ecosystem.
- Up-to-Date Dependencies: Always running on the latest versions for peak performance.
- Advanced Sharding: Implements
discord-hybrid-shardinganddiscord-cross-hostingfor efficient clustering and sharding. - Prisma Integration: Utilizes
prismaas a powerful database wrapper for PostgreSQL. - Comprehensive Tools: Comes with an integrated database, Redis cache, cross-hosting, and sharding capabilities.
- User-Friendly Commands: Jumpstart your bot with pre-generated commands (
npm run ...) for ease of use.
- Contact me in my discord server to be added
- discord.fish Bot - Click
- Clone handler:
git clone https://github.com/Undefined-Developers/Discord.js-v14-TS-handler handler. - Configure: Rename
config/config_sample.tstoconfig/config.tsin config folder. - Customize Configuration: Fill in the
config.tsas needed. Don't worry, not all fields are mandatory for initial setup, and defaults work just fine! - Initialization: Execute
npm run initand await the magic. - Launch: Once you see
SETUP IS DONEin the console, you're all set! Start handler withnpm run start. Discover more commands inpackage.json.
Success: Your bot is now live and ready to engage!
P.S. Everything was tested on node v22.12.0 and v20.17.0
I created this script to simplify and speed up setup, but if your host disallow file writes and/or you can't use scripts, there's manual way:
- Run
npm i. This will install all the required packages - Run
npm i -g pm2. This will install pm2 so bot will run in background without any consoles open. - Create following entries in .env:
DATABASE_URLand paste database link from configBOT_PROCESS_NAMEand paste botName from configTOKENand paste bot token from configAUTH_KEYand paste bridge_authToken from configREDISand paste redis link from config
- Paste following as scripts in package.json:
"scripts": {
"init": "npm install pm2 -g && npm install && npx tsx utils/init.ts && npx prisma db push && echo SETUP IS DONE",
"start": "pm2 start --name 'erry_handler' npx -- tsx index.ts && pm2 save && pm2 log 'erry_handler'",
"restart": "pm2 restart 'erry_handler' && pm2 log 'erry_handler'",
"stop": "pm2 stop 'erry_handler'",
"delete": "pm2 delete 'erry_handler' && pm2 save --force",
"start:cmd": "npx tsx index.js"
},
- Run
npx prisma db push. This will upload schemas to database so it can save data. - Init done!
