SkillAgentSearch skills...

Splite

SPLITE - Discord Bot with Slash Command Handler and Endpoint Handler, supporting AI, Music, Moderation, and more!

Install / Use

/learn @416rehman/Splite

README

<!--suppress ALL --> <div align=center> <a href="https://github.com/ZerioDev/Music-bot"> <img src="https://img.shields.io/badge/Music%20By-ZerioDev-green.svg" alt="Music by ZerioDev"> </a> <a href="https://discord.gg/pxnu3eF6DG"> <img src="https://discordapp.com/api/guilds/668625434157776896/widget.png?style=shield" alt="Join Splite's Support Server"> </a> <a href="https://github.com/discordjs"> <img src="https://img.shields.io/badge/discord.js-v14.6.0-gold.svg?logo=npm" alt="DiscordJS Version"> </a> <a href="https://github.com/sabattle/CalypsoBot"> <img src="https://img.shields.io/badge/Based%20on-Calypso-green.svg" alt="Based on Calypso Bot"> </a> </div>

SPLITE - Multi-Purpose Discord v14 Bot

Now with Slash Commands, Music, Moderation, and more!

New in Splite 5.0: Discord v14 support, YAML configuration, and many bug fixes

Splite is a free to use multipurpose Discord bot. It is designed to be a flexible and easy to use. ⭐ Consider starring the repo on GitHub to help with development! ⭐

<hr/>

Features

  • Robust and flexible command handler supporting text-based and slash commands, restrict to permission level, VCs, NSFW channels, bot owners, bot managers, and more.
  • Endpoint handler to listen to and respond to external web requests (Webhooks).
  • Music Module to play music in voice channels from YouTube, SoundCloud, and Spotify.
  • Logging features
  • Sniping features to see the last deleted or edited message in a channel.
  • Daily activity features and rewards (Points are earned through being active, most active user gets a role as reward until anothe winner is chosen the next day)
  • Betting and Gambling features - Users can gamble and bet against other users to win or lose their daily points.
  • Leaderboards to see the top active users, top moderators, and top points users.
  • Fun commands such as ship, mock, whowouldwin, and many many more.
<hr/>

Table of Contents

<hr/>

Setup

Prerequisites

  1. Clone the repo and install the dependencies with npm install
  2. Add the emojis from emojis.zip to your server and update the emoji IDs in src/utils/emoji.json to match your server's emoji IDs

Configuration

  1. Create a copy of the config.default.yaml called config.yaml.
  2. Fill the config.yaml file or alternatively, provide the corresponding environment variables (Click here for more information).
  3. OPTIONAL: If needed, environment variables can be used instead of a config file.

Starting the Bot

  1. Run npm run register to register all slash commands
  2. Run node app.js command to start the bot

If you wish to run the bot over pm2, use the command pm2 start

<hr/>

Cloud Configuration

Splite's configuration can be set via environment variables. This is useful for cloud deployments such as Heroku, and Repl.it.

Keep the following in mind when using environment variables:

  • Prefix the configuration key with SPLITE_.
  • Environment variables MUST be in all caps.
  • List values are separated by a comma.
  • Nested properties are separated by an underscore

Example:

| CONFIG.YAML | ENVIRONMENT VARIABLE | |----------------------------------------|--------------------------------------------| | token: "1234567890" | SPLITE_TOKEN=1234567890 | | owners: ["1234","1234"] | SPLITE_OWNERS=1234,1234 | | apiKeys.topGG.api_mode.token: "q1w2e3" | SPLITE_APIKEYS_TOPGG_API_MODE_TOKEN=q1w2e3 |

For convenience, the bot will output an environment variable equivalent of your config file upon startup.

Docker

To run the bot in Docker, fill the config.yaml config file, and run the following commands:

docker build -t splite .
docker run -d --name splite splite -v ./config.yaml:/home/node/app/config.yaml

You can also use environment variables by setting them in a .env file and running the following commands:

docker build -t splite .
docker run -d --name splite --env-file .env splite

For more information on the environment variables, see Cloud Configuration.

Modifying Functionality

Commands are stored in /src/commands/{category}/ directory<br> Events are stored in /src/events/ directory<br> Endpoints are stored in /src/endpoints/ directory<br>

Command Handler

Splite has a powerful command handler that extends the calypso handler, allowing you to serve both classic commands and slash commands from the same command class.<br>

Command Handler Features

  1. Cooldowns
  2. Exclusive / Instanced Commands (Only one instance of the command will be run per user, until the done() method is called)
  3. Aliases
  4. Categories/Types
  5. VC Only Commands
  6. NSFW Only Commands
  7. User Blacklist (Bot owner can use blacklist @user to blacklist a user)
  8. Restricted Commands - Owner type commands can only be used by the bot owner, Manager type commands can only be used by the bot managers and owners.

Creating Classic and Slash Commands - Code Sample

A command can be implemented using a classic text-based command, a slash command, or both.

In this section you will see how to create a command that can be used both as a classic command and a slash command.

Hybrid (Text and Slash) Command - Shows the avatar of a user

Classic text commands use the run(message, args) method of the Command class. Slash commands use the interact(interaction, args, author) method of the Command class.

// src/commands/fun/avatar.js

// Avatar Command
const Command = require('../Command.js');
const {EmbedBuilder} = require('discord.js');
const {SlashCommandBuilder} = require('discord.js');

module.exports = class AvatarCommand extends Command {
    // Command Info and Staging
    constructor(client) {
        super(client, {
            name: 'avatar',
            aliases: ['profilepic', 'pic', 'av'],
            usage: 'avatar [user mention/ID]',
            description: 'Displays a user\'s avatar (or your own, if no user is mentioned).',
            type: client.types.INFO,
            examples: ['avatar @split'],
            slashCommand: new SlashCommandBuilder()
                .addUserOption((option) =>
                    option.setName('user').setDescription('The user to display the avatar of.')),
        });
    }

    // Text Based Command Listener
    async run(message, args) {
        const member = await this.getGuildMember(message.guild, args.join(' ')) || message.member;

        this.handle(member, message);
    }

    // Slash Command Listener
    async interact(interaction) {
        await interaction.deferReply();
        const user = interaction.options.getUser('user') || interaction.member;
        this.handle(user, interaction);
    }

    // Core Logic
    handle(targetUser, context) {
        const embed = new EmbedBuilder()
            .setDescription(`[Avatar URL](${this.getAvatarURL(targetUser)})`)
            .setTitle(`${this.getUserIdentifier(targetUser)}'s Avatar`)
            .setImage(this.getAvatarURL(targetUser));

        this.sendReply(context, {embeds: [embed]});
    }
};

Command Types

  • MISC: This is the default type, and is used for commands that do not fit into any other category.
  • INFO: Commands that do not change the state of the data and are used to display information.
  • FUN: Commands that are used to entertain people.
  • POINTS: Commands that are used to manage user points, gambling, economy, etc.
  • SMASHORPASS: Commands that are used by the Smash or Pass system.
  • NSFW: Commands that are NSFW (Not Safe For Work). NOTE:These command will only work in NSFW channels.
  • MOD: Commands that can be used by server moderators to manage the server.
  • MUSIC: Commands that are used by the music system.
  • ADMIN: Commands that can be used by server admins to manage the server.
  • MANAGER: Commands that can be used by bot managers. NOTE These commands can ONLY be used by bot managers (set in config.yaml).
  • OWNER: Commands that can be used by the bot owner. NOTE These commands can ONLY be used by the bot owner (set in config.yaml).

Restrictions

These are the restrictions that can be set for a command.

Restrict command to Voice Channels

To restrict a text command to only be used if a user is in a voice channel, add and set the voiceChannelOnly property to true.

Example:

voiceChannelOnly: true // Default is false
Restrict command to NSFW channels

To res

View on GitHub
GitHub Stars104
CategoryDevelopment
Updated2mo ago
Forks29

Languages

JavaScript

Security Score

100/100

Audited on Jan 20, 2026

No findings