Readonly
descriptionReadonly
nameReadonly
pluginReadonly
scriptCreates or updates a command
See Commands.slashCommand, Commands.messageCommand and Commands.userCommand for more info on defining the commands themselves
use {@łink createStorageNumber}
Create new json storage buckets for persistent storage
a "name" or "id" for the bucket. This is not script scoped and the same storage bucket can be registered in multiple scripts to have access to the same data, this is perfectly safe.
interface Data{
key: string,
}
let funStorage = script.createStorageJson(new Storage.JsonBucket<Data>("fun-data"));
Creates a new number storage bucket for persistent storage.
This is the same as createStorageJson except that this bucket can only store number values, the upside of this is that it can be sorted.
An example use case could be storing the scores of users in a leveling system with the key being their user ID and the value being their score this way you can use Storage.NumberBucket.sortedList to get a sorted list of entries.
See createStorageJson for more general info on storage buckets
Create a new persistent variable.
This is built on top of storage buckets so you can think of it as a single entry inside a storage bucket.
Key for the variable inside the storage bucket, the same key in another script will refer to the same entry
Optional
options: StorageVarExtraOptionsAdditional options
Create a new persistent variable.
This is built on top of storage buckets so you can think of it as a single entry inside a storage bucket.
Key for the variable inside the storage bucket, the same key in another script will refer to the same entry
Optional
options: StorageVarExtraOptionsAdditional options
Optional
customRegister a general event handler such as for arbitrary discord events like when a new message is sent in the server (MESSAGE_CREATE)
Register a general event handler such as for arbitrary discord events like when a new message is sent in the server (MESSAGE_CREATE)
Register a general event handler such as for arbitrary discord events like when a new message is sent in the server (MESSAGE_CREATE)
Register a general event handler such as for arbitrary discord events like when a new message is sent in the server (MESSAGE_CREATE)
Register a general event handler such as for arbitrary discord events like when a new message is sent in the server (MESSAGE_CREATE)
Register a general event handler such as for arbitrary discord events like when a new message is sent in the server (MESSAGE_CREATE)
Register a general event handler such as for arbitrary discord events like when a new message is sent in the server (MESSAGE_CREATE)
Register a general event handler such as for arbitrary discord events like when a new message is sent in the server (MESSAGE_CREATE)
Register a general event handler such as for arbitrary discord events like when a new message is sent in the server (MESSAGE_CREATE)
Register a general event handler such as for arbitrary discord events like when a new message is sent in the server (MESSAGE_CREATE)
Register a general event handler such as for arbitrary discord events like when a new message is sent in the server (MESSAGE_CREATE)
Register a general event handler such as for arbitrary discord events like when a new message is sent in the server (MESSAGE_CREATE)
Register a general event handler such as for arbitrary discord events like when a new message is sent in the server (MESSAGE_CREATE)
Register a general event handler such as for arbitrary discord events like when a new message is sent in the server (MESSAGE_CREATE)
Register a general event handler such as for arbitrary discord events like when a new message is sent in the server (MESSAGE_CREATE)
Register a general event handler such as for arbitrary discord events like when a new message is sent in the server (MESSAGE_CREATE)
Register a general event handler such as for arbitrary discord events like when a new message is sent in the server (MESSAGE_CREATE)
Register a general event handler such as for arbitrary discord events like when a new message is sent in the server (MESSAGE_CREATE)
Register a general event handler such as for arbitrary discord events like when a new message is sent in the server (MESSAGE_CREATE)
Register a general event handler such as for arbitrary discord events like when a new message is sent in the server (MESSAGE_CREATE)
Register a general event handler such as for arbitrary discord events like when a new message is sent in the server (MESSAGE_CREATE)
Register a general event handler such as for arbitrary discord events like when a new message is sent in the server (MESSAGE_CREATE)
Register a general event handler such as for arbitrary discord events like when a new message is sent in the server (MESSAGE_CREATE)
Register a general event handler such as for arbitrary discord events like when a new message is sent in the server (MESSAGE_CREATE)
Register a general event handler such as for arbitrary discord events like when a new message is sent in the server (MESSAGE_CREATE)
Register a handler for button interactions
Register a handler for channel select menu interactions
Register a handler for mentionable select menu interactions
Register a handler for when people submit modals
Register a handler for role select menu interactions
Register a handler for text select menu interactions
Register a handler for user select menu interactions
Creates or resumes a interval timer.
The name of the timer, this is not namespaced to the current script. You could overwrite a timer from another script with the same name.
The interval, either in minutes for running the callback at every x minutes, or a cron style timer.
https://crontab.guru/ is a neat helper for making cron intervals
Callback to run at every interval
script.onInterval("gaming", "*/5 * * * *", () => {
// do stuff here
});
Register a scheduled task handler for the provided namespace.
See Tasks for more info about scheduled tasks and how to schedule a new one.
The task namespace to handle tasks from
The callback function to run, with the type of the data passed to the task when scheduled
Use createTaskBucket instead.
interface Data{
key: string,
}
script.onTask<Data>("fun-tasks", (task) => {
console.log("hello world");
});
Generated using TypeDoc
The script class is the main way you interact with botloader and discord.