Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major Update #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 119 additions & 0 deletions French/actions/French/action_anchor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
module.exports = {
//---------------------------------------------------------------------
// Action Name
//
// This is the name of the action displayed in the editor.
//---------------------------------------------------------------------

name: "Ancrage d'action",

//---------------------------------------------------------------------
// Action Section
//
// This is the section the action will fall into.
//---------------------------------------------------------------------

section: "D'autres choses",

//---------------------------------------------------------------------
// Action Subtitle
//
// This function generates the subtitle displayed next to the name.
//---------------------------------------------------------------------

subtitle(data, presets) {
return `${data.anchorName}`;
},

//---------------------------------------------------------------------
// Action Meta Data
//
// Helps check for updates and provides info if a custom mod.
// If this is a third-party mod, please set "author" and "authorUrl".
//
// It's highly recommended "preciseCheck" is set to false for third-party mods.
// This will make it so the patch version (0.0.X) is not checked.
//---------------------------------------------------------------------

meta: { version: "2.1.7", preciseCheck: true, author: null, authorUrl: null, downloadUrl: null },

//---------------------------------------------------------------------
// Action Fields
//
// These are the fields for the action. These fields are customized
// by creating elements with corresponding IDs in the HTML. These
// are also the names of the fields stored in the action's JSON data.
//---------------------------------------------------------------------

fields: ["anchorName"],

//---------------------------------------------------------------------
// Command HTML
//
// This function returns a string containing the HTML used for
// editing actions.
//
// The "isEvent" parameter will be true if this action is being used
// for an event. Due to their nature, events lack certain information,
// so edit the HTML to reflect this.
//---------------------------------------------------------------------

html(isEvent, data) {
return `
<span class="dbminputlabel">Anchor Name</span><br>
<input id="anchorName" class="round" type="text">`;
},

//---------------------------------------------------------------------
// Action Editor Init Code
//
// When the HTML is first applied to the action editor, this code
// is also run. This helps add modifications or setup reactionary
// functions for the DOM elements.
//---------------------------------------------------------------------

init() {},

//---------------------------------------------------------------------
// Action Bot Function
//
// This is the function for the action within the Bot's Action class.
// Keep in mind event calls won't have access to the "msg" parameter,
// so be sure to provide checks for variable existence.
//---------------------------------------------------------------------

action(cache) {
this.callNextAction(cache);
},

//---------------------------------------------------------------------
// Action Bot Mod Init
//
// An optional function for action mods. Upon the bot's initialization,
// each command/event's actions are iterated through. This is to
// initialize responses to interactions created within actions
// (e.g. buttons and select menus for Send Message).
//
// If an action provides inputs for more actions within, be sure
// to call the `this.prepareActions` function to ensure all actions are
// recursively iterated through.
//---------------------------------------------------------------------

modInit(data, customData, index) {
if (!customData.anchors) {
customData.anchors = {};
}
customData.anchors[data.anchorName] = index;
},

//---------------------------------------------------------------------
// Action Bot Mod
//
// Upon initialization of the bot, this code is run. Using the bot's
// DBM namespace, one can add/modify existing functions if necessary.
// In order to reduce conflicts between mods, be sure to alias
// functions you wish to overwrite.
//---------------------------------------------------------------------

mod() {},
};
124 changes: 124 additions & 0 deletions French/actions/French/action_container.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
module.exports = {
//---------------------------------------------------------------------
// Action Name
//
// This is the name of the action displayed in the editor.
//---------------------------------------------------------------------

name: "Conteneur d'actions",

//---------------------------------------------------------------------
// Action Section
//
// This is the section the action will fall into.
//---------------------------------------------------------------------

section: "D'autres choses",

//---------------------------------------------------------------------
// Action Subtitle
//
// This function generates the subtitle displayed next to the name.
//---------------------------------------------------------------------

subtitle(data, presets) {
return `${data.comment}`;
},

//---------------------------------------------------------------------
// Action Meta Data
//
// Helps check for updates and provides info if a custom mod.
// If this is a third-party mod, please set "author" and "authorUrl".
//
// It's highly recommended "preciseCheck" is set to false for third-party mods.
// This will make it so the patch version (0.0.X) is not checked.
//---------------------------------------------------------------------

meta: { version: "2.1.7", preciseCheck: true, author: null, authorUrl: null, downloadUrl: null },

//---------------------------------------------------------------------
// Action Fields
//
// These are the fields for the action. These fields are customized
// by creating elements with corresponding IDs in the HTML. These
// are also the names of the fields stored in the action's JSON data.
//---------------------------------------------------------------------

fields: ["comment", "actions"],

//---------------------------------------------------------------------
// Command HTML
//
// This function returns a string containing the HTML used for
// editing actions.
//
// The "isEvent" parameter will be true if this action is being used
// for an event. Due to their nature, events lack certain information,
// so edit the HTML to reflect this.
//---------------------------------------------------------------------

html(isEvent, data) {
return `
<div>
<span class="dbminputlabel">Comment</span><br>
<input id="comment" class="round" type="text">
</div>

<br><br>

<action-list-input id="actions" height="calc(100vh - 300px)"></action-list-input>`;
},

//---------------------------------------------------------------------
// Action Editor Init Code
//
// When the HTML is first applied to the action editor, this code
// is also run. This helps add modifications or setup reactionary
// functions for the DOM elements.
//---------------------------------------------------------------------

init() {},

//---------------------------------------------------------------------
// Action Bot Function
//
// This is the function for the action within the Bot's Action class.
// Keep in mind event calls won't have access to the "msg" parameter,
// so be sure to provide checks for variable existence.
//---------------------------------------------------------------------

action(cache) {
const data = cache.actions[cache.index];
const actions = data.actions;
this.executeSubActionsThenNextAction(actions, cache);
},

//---------------------------------------------------------------------
// Action Bot Mod Init
//
// An optional function for action mods. Upon the bot's initialization,
// each command/event's actions are iterated through. This is to
// initialize responses to interactions created within actions
// (e.g. buttons and select menus for Send Message).
//
// If an action provides inputs for more actions within, be sure
// to call the `this.prepareActions` function to ensure all actions are
// recursively iterated through.
//---------------------------------------------------------------------

modInit(data) {
this.prepareActions(data.actions);
},

//---------------------------------------------------------------------
// Action Bot Mod
//
// Upon initialization of the bot, this code is run. Using the bot's
// DBM namespace, one can add/modify existing functions if necessary.
// In order to reduce conflicts between mods, be sure to alias
// functions you wish to overwrite.
//---------------------------------------------------------------------

mod() {},
};
4 changes: 2 additions & 2 deletions French/actions/French/add_embed_field.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ module.exports = {
// This is the name of the action displayed in the editor.
//---------------------------------------------------------------------

name: "Ajouter un champs d'intégration",
name: "Ajouter un champ d'intégration",

//---------------------------------------------------------------------
// Action Section
//
// This is the section the action will fall into.
//---------------------------------------------------------------------

section: "Messagerie",
section: "Message Intégrer",

//---------------------------------------------------------------------
// Action Subtitle
Expand Down
120 changes: 120 additions & 0 deletions French/actions/French/add_embed_to_message_data.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
module.exports = {
//---------------------------------------------------------------------
// Action Name
//
// This is the name of the action displayed in the editor.
//---------------------------------------------------------------------

name: "Ajouter l'intégration aux données du message",

//---------------------------------------------------------------------
// Action Section
//
// This is the section the action will fall into.
//---------------------------------------------------------------------

section: "Message Intégrer",

//---------------------------------------------------------------------
// Action Subtitle
//
// This function generates the subtitle displayed next to the name.
//---------------------------------------------------------------------

subtitle(data, presets) {
return `Store ${presets.getVariableText(data.storage, data.varName)} in ${presets.getVariableText(data.editMessage, data.editMessageVarName)}`;
},

//---------------------------------------------------------------------
// Action Meta Data
//
// Helps check for updates and provides info if a custom mod.
// If this is a third-party mod, please set "author" and "authorUrl".
//
// It's highly recommended "preciseCheck" is set to false for third-party mods.
// This will make it so the patch version (0.0.X) is not checked.
//---------------------------------------------------------------------

meta: { version: "2.1.7", preciseCheck: true, author: null, authorUrl: null, downloadUrl: null },

//---------------------------------------------------------------------
// Action Fields
//
// These are the fields for the action. These fields are customized
// by creating elements with corresponding IDs in the HTML. These
// are also the names of the fields stored in the action's JSON data.
//---------------------------------------------------------------------

fields: ["storage", "varName", "editMessage", "editMessageVarName"],

//---------------------------------------------------------------------
// Command HTML
//
// This function returns a string containing the HTML used for
// editing actions.
//
// The "isEvent" parameter will be true if this action is being used
// for an event. Due to their nature, events lack certain information,
// so edit the HTML to reflect this.
//---------------------------------------------------------------------

html(isEvent, data) {
return `
<retrieve-from-variable dropdownLabel="Source Embed Object" selectId="storage" variableContainerId="varNameContainer" variableInputId="varName"></retrieve-from-variable>

<br><br><br><br>

<retrieve-from-variable dropdownLabel="Message Data to Edit" selectId="editMessage" variableInputId="editMessageVarName" variableContainerId="editMessageVarNameContainer"></retrieve-from-variable>`;
},

//---------------------------------------------------------------------
// Action Editor Init Code
//
// When the HTML is first applied to the action editor, this code
// is also run. This helps add modifications or setup reactionary
// functions for the DOM elements.
//---------------------------------------------------------------------

init() {},

//---------------------------------------------------------------------
// Action Bot Function
//
// This is the function for the action within the Bot's Action class.
// Keep in mind event calls won't have access to the "msg" parameter,
// so be sure to provide checks for variable existence.
//---------------------------------------------------------------------

action(cache) {
const data = cache.actions[cache.index];
const storage = parseInt(data.storage, 10);
const varName = this.evalMessage(data.varName, cache);
const embed = this.getVariable(storage, varName, cache);

if (embed) {
const editMessage = parseInt(data.editMessage, 10);
if (typeof editMessage === "number" && editMessage >= 0) {
const editVarName = this.evalMessage(data.editMessageVarName, cache);
const editObject = this.getVariable(editMessage, editVarName, cache);
if (Array.isArray(editObject.embeds)) {
editObject.embeds.push(embed);
} else {
editObject.embeds = [ embed ];
}
}
}

this.callNextAction(cache);
},

//---------------------------------------------------------------------
// Action Bot Mod
//
// Upon initialization of the bot, this code is run. Using the bot's
// DBM namespace, one can add/modify existing functions if necessary.
// In order to reduce conflicts between mods, be sure to alias
// functions you wish to overwrite.
//---------------------------------------------------------------------

mod() {},
};
2 changes: 1 addition & 1 deletion French/actions/French/add_member_role.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
// This is the name of the action displayed in the editor.
//---------------------------------------------------------------------

name: "Ajouter un rôle à un membre",
name: "Ajouter un rôle de membre",

//---------------------------------------------------------------------
// Action Section
Expand Down
Loading