0.22.2 • Published 1 year ago

splitscript.js v0.22.2

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

npm.io npm.io npm.io npm.io npm.io

A tiny discord bot framework

🔗 Contents

  1. 🏗 Project Structure
  2. 👂 Event listener
  3. 📜 Changelog
  4. ✅ To do

🏗 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

VersionDescription
0.0.8First stable version. Added discord.messages functions
0.1.0Added discord.messages.reactions functions
0.1.1Added logs for gateway errors
0.1.2Added a debugging mode (splitscript.debug()) to find issues and spam your logs
0.1.3Changed a debug error to a console.log
0.1.4Fixed bug with discord.messages.create
0.1.5Changed "\" 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.7Added JSDoc (for VSCode Intellisense) to discord.messagesAdded discord.channels functions (no JSDoc)
0.1.8Added discord.emojis
0.1.9Added discord.invites
0.10.0Added discord.interactions.commands Changed version number to be semantic (from 0.1.9 => 0.10.0)
0.10.1Fixed unsupported markdown in README.md
0.10.2Discord bots now stay online 24/7 - closed websocket connections automatically reconnect
0.11.0Added discord.interactions.responses
0.12.0Added discord.interactions.followups
0.12.1Removed 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.2Updated imports for variable.js in debug.js
0.13.0application_id is automatically grabbed from token - interactions functions no longer have application_id parameter
0.13.1Updated README.md
0.13.2Updated README.md
0.13.3Updated README.md (fixed issue with centering )
0.14.0Swapped from axios to a much smaller splitscript.https added some guilds functions
0.15.0splitscript.https exported in index.js
0.15.1Added ts declaration files
0.15.2Updated readme.md and package.json
0.15.3updated readme.md
0.15.4Removed jsdoc for messages.js
0.16.0Added rest of functions for discord.guilds
0.17.0Added discord.users and some discord.guilds functions
0.17.1Added 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.0Added discord.automod
0.19.0Added discord.stageInstances
0.20.0Added discord.scheduledEvents
0.21.0Added discord.templates
0.21.1Removed discord.guilds.members.roles (Fix cannot read properties of undefined error )
0.22.0Improved file stucture, added discord.generateIntents()
0.22.1Added discord api path to start of all requests
0.22.2package.json update

✅ ToDo

ModuleFunctionDocumentation
discord.stickersdiscord.dev
discord.webhooksdiscord.dev
0.20.0

1 year ago

0.19.0

1 year ago

0.15.4

1 year ago

0.13.0

1 year ago

0.13.1

1 year ago

0.15.0

1 year ago

0.13.2

1 year ago

0.15.1

1 year ago

0.13.3

1 year ago

0.17.0

1 year ago

0.15.2

1 year ago

0.17.1

1 year ago

0.15.3

1 year ago

0.21.1

1 year ago

0.21.0

1 year ago

0.18.1

1 year ago

0.12.1

1 year ago

0.14.0

1 year ago

0.12.2

1 year ago

0.16.0

1 year ago

0.18.0

1 year ago

0.22.2

1 year ago

0.22.1

1 year ago

0.22.0

1 year ago

0.12.0

1 year ago

0.11.0

1 year ago

0.10.2

1 year ago

0.10.1

1 year ago

0.10.0

1 year ago

0.1.9

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago