Skip to content

Commit

Permalink
Updated a few things! (#1047)
Browse files Browse the repository at this point in the history
* Updated with 2 things

Added create primitive mod

Added seperator mod

* Updated these with lint

* Updated these with lint

* Updated canvas_create_primitive_MOD.js

* Added json_read_MOD

added json_write_MOD.js

* Added json_read_MOD

added json_write_MOD.js

* Added json_read_MOD

added json_write_MOD.js

* Added json_read_MOD

added json_write_MOD.js

* Fixed lint issue I hope

* Fixed lint issue I hope

* Fixed prettier issues

Fixed linting issues inside json write

Fixed issue with canvas paint not using cases

* Added json random

* **Changelog**

* Fixed json_random_MOD.js meta data

* Fixed json_read_MOD.js meta data

* Added json_check_MOD.json

* **Changelog**

* Fixed json_random_MOD.js meta data

* Fixed json_read_MOD.js meta data

* Added json_check_MOD.json

* **Changelog**

* Fixed json_random_MOD.js meta data

* Fixed json_read_MOD.js meta data

* Added json_check_MOD.json

* **Changelog**

* Fixed json_random_MOD.js meta data

* Fixed json_read_MOD.js meta data

* Added json_check_MOD.json

* **Changelog**

* added nested check

* **Changelog**

* removed error handler

* **Changelog**

* removed error handler

* **Changelog**

* Updated all json actions to make them more clear

* **Changelog**

* Created a mod version of get_list_length_MOD.js this one only returns a number for the list length and not a list like 1,2,3. this also makes it so if the list is empty or is not a list it will be undefined

* **Changelog**

* Created a mod version of get_list_length_MOD.js this one only returns a number for the list length and not a list like 1,2,3. this also makes it so if the list is empty or is not a list it will be undefined

* Fixed Title

* Added console event action

* Added console event action

* Added console event action

* RE added the convert packages

* Fixed json read

* Added a function to delete threads!

---------

Co-authored-by: OneAndOnlyFinbar <[email protected]>
  • Loading branch information
thekingofspace and OneAndOnlyFinbar authored Jul 22, 2024
1 parent bef206a commit f220a83
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions actions/delete_thread_MOD.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
module.exports = {
name: 'Delete Thread',
section: 'Channel Control',
subtitle(data, presets) {
return `Delete Thread: "${presets.getChannelText(data.thread, data.threadVarName)}"`;
},
meta: { version: '2.1.7', preciseCheck: true, author: null, authorUrl: null, downloadUrl: null },
fields: ['thread', 'threadVarName', 'reason'],
html() {
return `
<thread-channel-input dropdownLabel="Source Thread" selectId="thread" variableContainerId="varNameContainer" variableInputId="threadVarName"></thread-channel-input>
<br><br><br><br>
<div style="float: right; width: calc(102% - 12px);">
<span class="dbminputlabel">Reason</span>
<input id="reason" placeholder="Optional" class="round" type="text">
</div>`;
},
init() {},
async action(cache) {
const data = cache.actions[cache.index];
const thread = await this.getChannelFromData(data.thread, data.threadVarName, cache);
const reason = this.evalMessage(data.reason, cache);
if (Array.isArray(thread)) {
this.callListFunc(thread, 'delete', [reason]).then(() => this.callNextAction(cache));
} else if (thread?.delete) {
thread
.delete(reason)
.then(() => this.callNextAction(cache))
.catch((err) => this.displayError(data, cache, err));
} else {
this.callNextAction(cache);
}
},
mod() {},
};

0 comments on commit f220a83

Please sign in to comment.