Перейти к основному содержимому

Creating mods

This guide provides detailed instructions on creating mods for Bot Maker for Discord (BMD).

Also, please follow the general structure when creating mods. Therefore, add _MOD after your mod name, don't include any additional dots or spaces, and make sure to include the info object within your modded action. Feel free to add a short description for your action as seen in animeSearch_MOD.js.

:icon-image: Interface Components

Actions

Use this website as an easy way to create an action.

Example action code

module.exports = {
data: {
name: "Name", //Mods name
},
category: "Category", //Category that will group together
info: {
source: "https://github.com/<username>/<repo>",
creator: "Author", //Creators Name
donation: "https://paypal.me/<username>"
},
UI: [
{
"element": "input",
"name": "Name",
"storeAs": "Variable"
}
],
subtitle: (values) => {return `Path: ${values.path}`},
compatibility: ["Any"],

//Script
//Code here...
};

Elements

+++ Interaction

Interaction Inputs:

{
"element": "interaction",
"storeAs": "string_pointing_to_object"
}

+++ Image

Image Inputs:

{
"element": "image",
"storeAs": "string_pointing_to_object"
}

+++ Message

Message Inputs:

{
"element": "message",
"storeAs": "string_pointing_to_object"
}

+++ Other

Actions:

{
"element": "actions",
"storeAs": "string"
}

Conditional Actions & Additional Options:

{
"element": "condition",
"storeAs": "string_pointing_to_object",
"storeActionsAs": "string_pointing_to_array"
}

+++ Role

Role Inputs:

{
"element": "role",
"storeAs": "string_pointing_to_object"
}

+++ Text

Text:

{
"element": "text",
"text": "string"
}

Large Inputs:

{
"element": "largeInput",
"storeAs": "string_pointing_to_string"
}

+++

Events

Use this website as an easy way to create an event.

Example event code

module.exports = {
data: {
name: "Name", //Mods name
},
category: "Category", //Category that will group together
info: {
source: "https://github.com/<username>/<repo>",
creator: "Author", //Creators Name
donation: "https://paypal.me/<username>"
},
UI: [
{
"element": "input",
"name": "Name",
"storeAs": "Variable"
}
],
subtitle: (values) => {return `Path: ${values.path}`},
compatibility: ["Any"],

//Script
//Code here...
};

Elements

Themes

Elements

Bridge Controls

+++ Call

call:

(blob, actions) :: [ASYNC] Blob: Condition generated Object | Actions: Condition generated array :: Promise

callActions:

(blob) :: [ASYNC] Blob: Object with any of these properties: {stop, jump, skip, actions} - Stop: Boolean, Jump: Number, Skip: Number, Actions: Array :: Promise

+++ Create

createTemporary:

(blob) :: Blob: Object with these properties: {class, name, value} - Class: String (Optional) - Name: String - Value: Any; Creates temporary values in storage for sharing between a group's actions for context, inaccessible to the user. See joinVoiceChannel actions for examples :: Void

createGlobal:

(blob) :: Blob: Object with these properties: {class, name, value} - Class: String (Optional) - Name: String - Value: Any; Creates global values in storage for sharing between a group's actions for context, inaccessible to the user. See createAnchor for examples :: Void

+++ Get get:

(blob) :: Blob: variableInput generated object :: Value of variable

getUser:

[ASYNC] (blob) :: Blob: userInput generated Object :: [User](https://docs.oceanic.ws/v1.9.0/classes/User.html) with a `member` [OPTIONAL] property

getChannel:

[ASYNC] (blob) :: Blob: channelInput generated Object :: [Channel](https://docs.oceanic.ws/v1.9.0/classes/Channel.html)

getImage:

[ASYNC] (blob) :: Blob: image (input) generated Object :: Image Buffer

getRole:

[ASYNC] (blob) :: Blob: roleInput generated Object :: [Role](https://docs.oceanic.ws/v1.9.0/classes/Role.html)

getTemporary:

(blob) :: Blob: Object with these properties: {class, name} - Class: String (Optional) - Name: String :: Any

getGlobal:

(blob) :: Blob: Object with these properties: {class, name} - Class: String (Optional) - Name: String :: Any

getInteraction:

[ASYNC] (blob) :: Blob: interactionInput generated Object :: [Interaction](https://docs.oceanic.ws/v1.9.0/classes/Interaction.html)

+++ generate

generateCustomID:

() :: null :: Number

+++ Runner

runner:

(actions) :: [ASYNC] Blob: actions generated Array :: Promise

+++ Store

store:

(blob) :: Blob: storageInput generated Object :: Void

+++ Transfer

transf:

(inputText) :: inputText: text to transform variables from ${...} to their values :: String

+++