Welcome to NEXUS, a project hosted by Toowake Development.
Quick Links | Getting Started | Terms of Service | Support Us | Credits
- Panel: Nexhost Panel
- Discord: Join Our Server
- Docs: https://docs.cptcr.cc/
- Website: https://page.nexus.cptcr.cc
Before you begin, ensure the following:
- A Discord bot ready. Create one at the Discord Developer Portal.
- Your bot listed on top.gg and Omen List.
.env
file filled out. Tutorial: .env Tutorial.- Read the discord.js Documentation.
- Read the discord.js Guide
- Install every npm listed in package.json
The code for the Wesbite can be found at https://github.com/cptcr/nexus/website
Build command: docker build -t my-discord-bot .
Push to docker registry:
- Tag:
docker tag my-discord-bot myusername/my-discord-bot
- Push:
docker push myusername/my-discord-bot
Dockerfile
# Use the official Node.js image from the Docker Hub
FROM node:14
# Create and change to the app directory
WORKDIR /usr/src/app
# Copy package.json and package-lock.json to the working directory
COPY package*.json ./
# Install app dependencies
RUN npm install
# Copy the rest of the application code to the working directory
COPY . .
# Expose the port the app runs on (if applicable)
# EXPOSE 8080
# Define environment variables (if needed)
# ENV NODE_ENV=production
# Run the bot
CMD ["node", "index.js"]
.dockerignore
node_modules
npm-debug.log
Dockerfile
.dockerignore
Info Point:
- Added new scripts (check package.json and the files mentioned in scripts)
- Fixed import issues
- Implemented the new handler (code: https://github.com/cptcr/discord-bot-handler)
- Added DevOnly Commands
- Added Custom Commands
- Added DveGuild Commands
- Added User Installed Commands Handler
- Added Blacklist Command
- Added several new commands
- Edited client events
- No unauthorized use of the Nexus Logo.
- Code is free and not for sale.
- Terms subject to change without notice.
- Do not claim this code as your own.
- Encouraged to keep bot services free.
- Do not use our Terms and Privacy Policy for your bot.
- Discord API Interaction: discord.js
- JavaScript runtime environment: NodeJS
- Code Editor: Microsoft Visual Studio Code
- Live Share: Microsoft Live Share
- Error Detection Tool: Alexander Error Lens
- IMDB API: Tuhin Kanti Pal - IMDB API
This advanced Discord.js Bot/Client Handler simplifies the development of robust Discord bots through a structured and feature-rich framework. It includes easy-to-use handlers for commands, events, interactions, and more, providing a solid foundation for building sophisticated bots with both custom and developer-only commands.
- Documentation: Visit our comprehensive documentation for detailed guidance on implementing and customizing the bot. The documentation might differ slightly but remains a reliable resource for most code implementations.
- Inspiration: This project is inspired by content from MrJAwesome's YouTube channel, which provides valuable insights into Discord bot development.
Name | Minimum | Recommended |
---|---|---|
discord.js | 14.0.0 | 14.5.3 |
NodeJS | 14.0.0 | 16.0.0 |
CPU | 1 GHz single-core | 2 GHz dual-core |
RAM | 512 MB | 1 GB |
Internet Latency | < 200 ms | < 100 ms |
Bandwidth | 1 Mbps download/upload | 5 Mbps download/upload |
Storage | 1 GB free space | 2 GB free space |
Operating System | Windows, macOS, Linux | Windows, macOS, Linux |
Network | 1 Mbps download/upload | 5 Mbps download/upload |
Database | Not required (basic bots) | MongoDB, MySQL, PostgreSQL |
Dependencies | Basic npm packages | Managed npm dependencies |
Environment | Local development setup | Separate dev/prod environments |
Backup | Manual backups | Automated backup solutions |
Security | Basic firewall rules | Regular updates and security patches |
- Easy Command Handling: Streamline command creation using the dedicated
commands
folder. - Event Handling: Efficient management of Discord.js events through the
Event Handler
folder. - Support for Slash Commands: Incorporate slash commands with ease using the
@discordjs/rest
package. - Developer Guild Commands: Deploy commands exclusively in the developer guild (folder:
src/dev
). - Custom Commands: Facilitate server-specific custom commands and validate their existence (folder:
src/custom-commands
). - User Installed Commands: Utilize Discord's newest features for user-installed commands.
- Configurable Settings: Utilize the
.env
file for essential configurations like tokens and database connections. - Interaction Logs: Automatic logging of interactions within the
logs
folder, generating text files for record-keeping. - Error Handling: Robust error management that logs issues to the console without halting the bot.
- Developer Only Commands: Restrict certain commands to bot developers for testing and debugging.
- Token Generator: Generate tokens for various applications; specific usage is open to developer discretion.
- Express Handler: Simplify the management of Express websites within the
express
folder. - Component Handling: Efficient management of interactive components.
- Multiple Databases Support: Connect to a database of your choice (MariaDB, MongoDB, Postgres, Redis, SQLite) through
database.config.json
. - Sharding: Integrate a sharding system to scale the bot across multiple servers.
- Autocomplete: Implement autocomplete functionality in commands.
- TypeScript Support: Full support for both JavaScript and TypeScript, enhancing development flexibility.
The .env file will be generated automatically at the first start of the bot. Restart after the final setup by using CTRL + C to end the console process and then type node .
- Clone the Repository: Begin by cloning the repository to your local machine or server.
- Install Dependencies: Run
npm install
to install all required dependencies. - Configure the .env File: Fill in the
.env
file with your bot's specific details like token, database URI, and others. - Run the Bot: Start your bot using
node src/index.js
or your preferred command as configured in your package.json.
Join our community on Discord to get support, share ideas, and collaborate with other developers. You can also contribute to the project by submitting pull requests or reporting issues on our GitHub repository.
- Gaming Communities: Enhance engagement with features like game integrations, matchmaking, and more.
- Educational Platforms: Use the bot to manage virtual classrooms, distribute assignments, and facilitate learning through quizzes and interactive sessions.
- Business Operations: Automate tasks, handle customer inquiries, and streamline communication within teams.
To get started with this bot handler, clone the repository, configure the .env file as described, and review the documentation to understand the framework structure and feature set. This handler is designed to accommodate both beginner and advanced developers with its extensive customization capabilities and built-in functionality.
Discord.js is a powerful library for interacting with the Discord API, and while frameworks like Sapphire offer additional features and abstractions, there are several reasons why developers might choose to use discord.js directly:
- Lower Level Control: Using discord.js directly provides finer control over bot behavior and interactions. This direct interaction with the API allows for more custom and complex features tailored to specific needs.
- Flexibility: Developers can design the architecture and features of their bots without the constraints or assumptions made by higher-level frameworks.
- Fundamental Understanding: Working directly with discord.js encourages a deeper understanding of the Discord API and bot mechanics. This knowledge is invaluable for debugging and extending bot functionality.
- Community Resources: discord.js has a vast and active community, with extensive documentation and examples. This makes it easier for new developers to learn and solve issues independently.
- Reduced Overhead: Using discord.js without additional frameworks can reduce computational overhead, potentially leading to faster response times and lower resource consumption.
- Simplicity: For smaller or less complex bots, the additional features offered by frameworks like Sapphire might not justify the extra layer of complexity and the performance implications.
- Custom Implementations: Direct use of discord.js allows developers to implement custom solutions that might not be supported or easily achievable within the confines of a framework.
- Selective Feature Integration: Developers can choose to integrate only the features they need, potentially leading to a more optimized and efficient bot.
- Fewer Dependencies: Operating directly with discord.js means fewer dependencies and potential points of failure related to external frameworks.
- Up-to-date with Discord API: Direct use ensures that the latest features of the Discord API are accessible as soon as they are supported by discord.js, without waiting for the framework to catch up.
Choosing between discord.js and a framework like Sapphire depends on the specific needs and skills of the developer. Those seeking direct control, a deep understanding of Discord bot workings, and high customization might prefer using discord.js directly. Meanwhile, developers looking for quicker deployments and less boilerplate code might opt for frameworks like Sapphire.
- Autocomplete Setup: https://docs.sxssy.xyz/commands/autocomplete
- Creating Commands: https://docs.sxssy.xyz/commands/creating-commands
- Creating Developer Commands: https://docs.sxssy.xyz/commands/creating-developer-commands
- Creating Custom Bot Functions: https://docs.sxssy.xyz/building-the-bot/custom-bot-functions
- Database Integration
MongoDB
: https://docs.sxssy.xyz/database/mongodb-connection - User Installed Commands: https://docs.sxssy.xyz/commands/creating-user-installed-commands