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! ⭐
- Clone the repo
- Add the emojis from emojis.zip to your server
- Update src/utils/emoji.json to use emojis from your server
- Fill the config.js file - Incomplete config.js file might result in bot not functioning properly
- Run
npm i
in the repo directory to install dependencies - Run
node app.js
command to run the bot
If you wish to run the bot over pm2, use the command pm2 ecosystem.config.js
Commands are stored /src/commands/commands/{category}/
directory
Slash Commands are stored /src/commands/slashCommands/{category}/
directory
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.
Features include
- Cooldowns
- Exclusive / Instanced Commands (Only one instance of the command will be run per user, until the done() method is called)
- Aliases
- Categories/Types
module.exports = class prefixCommand extends Command {
constructor(client) {
super(client, {
name: 'prefix',
description: 'Shows the prefix of the bot',
type: client.types.INFO,
examples: ['prefix'],
clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS', 'ADD_REACTIONS'],
cooldown: 5
});
}
async run(message, args) {
console.log(`The first argument is ${args[0]}`)
const prefix = message.client.db.settings.selectPrefix.pluck().get(message.guild.id);
message.channel.send({
embeds: [new MessageEmbed().setTitle(`${message.client.config.name}'s Prefix`)
.setDescription(`To change the prefix: \`${prefix}prefix <new prefix>\``)
.addField(`Current Prefix`, `**\`${prefix}\`**`)
.setThumbnail(message.client.user.displayAvatarURL())
.setFooter({
text: message.member.displayName,
iconURL: message.author.displayAvatarURL({dynamic: true})
})
.setTimestamp()]
})
}
}
module.exports = class prefixCommand extends Command {
constructor(client) {
super(client, {
name: 'prefix',
description: 'Shows the prefix of the bot',
type: client.types.INFO,
examples: ['prefix'],
clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS', 'ADD_REACTIONS'],
cooldown: 5,
slashCommand: new SlashCommandBuilder()
.addStringOption(options => options
.setName('argument name')
.setDescription(`argument description`))
});
}
async run(interaction, args) {
console.log(`The first argument is ${args[0]}`)
const prefix = interaction.client.db.settings.selectPrefix.pluck().get(interaction.guild_id);
interaction.reply({
embeds: [new MessageEmbed().setTitle(`${interaction.client.config.name}'s Prefix`)
.setDescription(`To change the prefix: \`${prefix}prefix <new prefix>\``)
.addField(`Current Prefix`, `**\`${prefix}\`**`)
.setThumbnail(interaction.client.user.displayAvatarURL())
.setFooter({
text: interaction.author.tag,
iconURL: interaction.author.displayAvatarURL({dynamic: true})
})
.setTimestamp()],
ephemeral: true
})
}
}
Cooldowns are handled by the commands own instance. Each command has a cooldowns collection and a default cooldown of 2 seconds. A cooldown can be specified by adding the cooldown
option in the constructor of the command.
If the exclusive
option is set to true in the constructor for the command, the calling user will not be able to call that function again until the done() method is called.
This is useful for commands whose functionality might not be instant. For example, the kick
command is not instant, when it is called, a prompt is displayed to the calling user, and it awaits the user response. While the command is awaiting the user response, the user can call the kick command again, and now there's more than one instances of the command waiting for the user's response.
We can avoid this by setting the exclusive
option to true, and when the command finishes listening for the user's response, we can call the done()
method. Now the user will only be able to call this method again only after that done()
method is called.,
In the below example, once the user calls the prefix
command, they won't be able to call it again, until 30 seconds after that command has been run.
module.exports = class prefixCommand extends Command {
constructor(client) {
super(client, {
name: 'prefix',
description: 'Shows the prefix of the bot',
type: client.types.INFO,
examples: ['prefix'],
clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS', 'ADD_REACTIONS'],
cooldown: 10,
exclusive: true
});
}
async run(interaction, args) {
const prefix = interaction.client.db.settings.selectPrefix.pluck().get(interaction.guild_id);
message.reply({
embeds: [new MessageEmbed().setTitle(`${interaction.client.config.name}'s Prefix`)
.setDescription(`To change the prefix: \`${prefix}prefix <new prefix>\``)
.addField(`Current Prefix`, `**\`${prefix}\`**`)
.setThumbnail(interaction.client.user.displayAvatarURL())
.setFooter({
text: interaction.author.tag,
iconURL: interaction.author.displayAvatarURL({dynamic: true})
})
.setTimestamp()]
})
setTimeout(()=>{
this.done(message.author.id)
console.log(`The user can call the command now`);
}, 30000)
}
}
You should make sure your exclusive commands always call the done method.
If you forget to call the done() method, the bot will automatically call the done method 5 minutes after the command was run to prevent unwanted lockouts from running the command
activity
, admins
, aliases
, avatar
, botinfo
, channelinfo
, emojis
, help
, inviteme
, mods
, permissions
, ping
, prefix
, roleinfo
, servercount
, servericon
, serverinfo
, serverstaff
, snipe
, editsnipe
, stats
, uptime
, whois
, ratemyprofessor
, vote
, modactivity
8ball
, afk
, approved
, awooify
, baguette
, beautiful
, bio
, bird
, biryani
, blur
, blurple
, brazzers
, burn
, cat
, catfact
, challenger
, changemymind
, circle
, clyde
, coinflip
, contrast
, crush
, dadjoke
, deepfry
, dictator
, distort
, dither
, dog
, dogfact
, duck
, dungeon
, emboss
, emojify
, enlarge
, fire
, fox
, frame
, gay
, geoguessr
, glitch
, greyple
, greyscale
, hate
, instagram
, insult
, invert
, jail
, magik
, meme
, missionpassed
, mock
, moustache
, nsfw
, pickup
, pixelize
, posterize
, ps4
, redple
, rejected
, rip
, roll
, rps
, scary
, sepia
, sharpen
, shibe
, ship
, sniper
, thanos
, thouart
, threats
, tobecontinued
, trap
, triggered
, trumptweet
, unsharpen
, urban
, tatoo
, wanted
, wasted
, whowouldwin
, yesno
, yomomma
, youtube
bet
, crown
, explainpoints
, gamble
, givepoints
, leaderboard
, points
, pointsper
, position
, rigship
, totalpoints
, odds
matches
, optout
, resetsmashorpass
, smashorpass
, unmatch
feedback
, reportbug
addemoji
, addrole
, ban
, kick
, members
, mute
, purge
, purgebot
, removeemoji
, role
, setnickname
, slowmode
, softban
, testfarewell
, testwelcome
, unban
, unmute
, warn
, warnpurge
, warns
back
, filter
, loop
, nowplaying
, pause
, play
, progress
, queue
, resume
, save
, search
, seek
, shuffle
, skip
, stop
, volume
Commands can be cleared by replacing "set" with "clear". i.e setmodlog
➔ clearmodlog
findstatus
, say
, setjoinvoting
, setadminrole
, setautokick
, setautorole
, setconfessionchannel
, setcrownchannel
, setcrownrole
, setfarewellchannel
, setfarewellmessage
, setmemberlog
, setmessagedeletelog
, setmessageeditlog
, setmodchannels
, setmodlog
, setmodrole
, setmuterole
, setnicknamelog
, setprefix
, setrolelog
, setstarboardchannel
, setsystemchannel
, settings
, setverificationchannel
, setverificationmessage
, setverificationrole
, setviewconfessionsrole
, setwelcomechannel
, setwelcomemessage
, toggleanonymous
, togglecommand
, toggletype
blacklist
, blast
, eval
, leaveguild
, servers
, setodds
, setpoints
, whitelist
, wipeallpoints
, wipealltotalpoints
, wipepoints
, wipetotalpoints
/anonymous
Post anonymous message. Cost: 50 points
/confess
Post a confession in confessions channel.
/report
Report a confession.
/view
View details of a confession.