splitscript.js v0.22.2
A tiny discord bot framework
🔗 Contents
🏗 Project structure
A SplitScript.js project has:
- a
functions/
folder for listening to events - a
files/
folder for managing files with SplitScript.fs - a main file (e.g: main.js, index.js) for setting up the listener
E.g:
functions/
discord/
ready/
start.js
message/
create/
1.js
interaction/
create/
command.js
index.js
package.json
package-lock.json
👂 Listening to events
To listen to events on discord, use the discord.listen
function in your main file:
const { discord } = require('splitscript.js');
discord.listen('TOKEN', {
intents: INTEGER
});
intents
must be a valid discord intent or the connection will close
Create event listener
See the docs for a list of event paths
Create a .js
file with any name in the event path listed above.
In that, put the code:
// functions/discord/path
const { discord } = require('splitscript.js');
module.exports = async function (event) {
// Run some code
};
You can write the code that you want to run in the function.
📜 Changelog
Version | Description |
---|---|
0.0.8 | First stable version. Added discord.messages functions |
0.1.0 | Added discord.messages.reactions functions |
0.1.1 | Added logs for gateway errors |
0.1.2 | Added a debugging mode (splitscript.debug() ) to find issues and spam your logs |
0.1.3 | Changed a debug error to a console.log |
0.1.4 | Fixed bug with discord.messages.create |
0.1.5 | Changed "\" in file paths to "/" to support linux systems |
0.1.6 | (hopefully) fixed a bug in the gateway where the connection would not be kept |
0.1.7 | Added JSDoc (for VSCode Intellisense) to discord.messages Added discord.channels functions (no JSDoc) |
0.1.8 | Added discord.emojis |
0.1.9 | Added discord.invites |
0.10.0 | Added discord.interactions.commands Changed version number to be semantic (from 0.1.9 => 0.10.0 ) |
0.10.1 | Fixed unsupported markdown in README.md |
0.10.2 | Discord bots now stay online 24/7 - closed websocket connections automatically reconnect |
0.11.0 | Added discord.interactions.responses |
0.12.0 | Added discord.interactions.followups |
0.12.1 | Removed object style parameters for discord.messages functions Renamed auth.js to variable.js to fit what it actually does Fixed bugged error handling in discord.messages functions |
0.12.2 | Updated imports for variable.js in debug.js |
0.13.0 | application_id is automatically grabbed from token - interactions functions no longer have application_id parameter |
0.13.1 | Updated README.md |
0.13.2 | Updated README.md |
0.13.3 | Updated README.md (fixed issue with centering ) |
0.14.0 | Swapped from axios to a much smaller splitscript.https added some guilds functions |
0.15.0 | splitscript.https exported in index.js |
0.15.1 | Added ts declaration files |
0.15.2 | Updated readme.md and package.json |
0.15.3 | updated readme.md |
0.15.4 | Removed jsdoc for messages.js |
0.16.0 | Added rest of functions for discord.guilds |
0.17.0 | Added discord.users and some discord.guilds functions |
0.17.1 | Added discord.guilds.getAuditLog , discord.guilds.members.(modifyMe/me) now discord.guilds.members.me.(modify/get) , discord.guilds.vanity now discord.guilds.getVanity , discord.guilds.preview now discord.guilds.getPreview |
0.18.0 | Added discord.automod |
0.19.0 | Added discord.stageInstances |
0.20.0 | Added discord.scheduledEvents |
0.21.0 | Added discord.templates |
0.21.1 | Removed discord.guilds.members.roles (Fix cannot read properties of undefined error ) |
0.22.0 | Improved file stucture, added discord.generateIntents() |
0.22.1 | Added discord api path to start of all requests |
0.22.2 | package.json update |
✅ ToDo
Module | Function | Documentation |
---|---|---|
discord | .stickers | discord.dev |
discord | .webhooks | discord.dev |
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago