Skip to content

Commit

Permalink
Set Prefix + Write File + Jump to Action
Browse files Browse the repository at this point in the history
- Set Voice Channel Permissions
- Write File (Creates a real file like a txt file)
- Set Prefix (Global)
- Jump to Action
- Merged all Store Bot Client Info mods (Check info below)
- Merged all Store Server Things mods (Check info below)
- Reduced file size (We removed some obsolete modules 150 MB vs 15 KB)
- Bug and typo fixes
- Removed the music and discord.js fix because it is in beta fixed
The merged actions are still useable but are located in the deprecated section. All functions are copied info the main action.
  • Loading branch information
LunaNiermann authored Feb 3, 2018
2 parents c262dcd + d094a76 commit f5d6217
Show file tree
Hide file tree
Showing 2,650 changed files with 627 additions and 342,556 deletions.
67 changes: 49 additions & 18 deletions actions/update_discord_js_MOD.js → actions/change_prefix_MOD.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ module.exports = {
// This is the name of the action displayed in the editor.
//---------------------------------------------------------------------

name: "Update discord.js",
name: "Change Prefix",

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

section: "Other Stuff",
section: "Bot Client Control",

//---------------------------------------------------------------------
// Action Subtitle
Expand All @@ -23,9 +23,29 @@ section: "Other Stuff",
//---------------------------------------------------------------------

subtitle: function(data) {
return `Updates discord.js for your bot`;
return `Change Prefix`;
},

//---------------------------------------------------------------------
// DBM Mods Manager Variables (Optional but nice to have!)
//
// These are variables that DBM Mods Manager uses to show information
// about the mods for people to see in the list.
//---------------------------------------------------------------------

// Who made the mod (If not set, defaults to "DBM Mods")
author: "EliteArtz & General Wrex",

// The version of the mod (Defaults to 1.0.0)
version: "1.8.4",

// A short description to show on the mod line for this mod (Must be on a single line)
short_description: "Change Prefix from Bot",

// If it depends on any other mods by name, ex: WrexMODS if the mod uses something from WrexMods


//---------------------------------------------------------------------

//---------------------------------------------------------------------
// Action Storage Function
Expand All @@ -43,7 +63,7 @@ subtitle: function(data) {
// are also the names of the fields stored in the action's JSON data.
//---------------------------------------------------------------------

fields: [],
fields: ["pprefix"],

//---------------------------------------------------------------------
// Command HTML
Expand All @@ -65,15 +85,16 @@ html: function(isEvent, data) {
return `
<div>
<p>
<u>Warning:</u><br>
This action updates your discord.js version to the latest one.<br>
DBM Mods is not responsible for any lost commands or events!<br>
We suggest you to do an update from your complete mod folder before updating.<br><br>
To update your version simply create a command and add this action.<br>
The update should allow you to use category stuff and activity stuff.<br><br>
Check your bot log for the installation log (Project -> Open Bot Log)!
<u>Mod Info:</u><br>
Made by EliteArtz<br>
</p>
</div>`
<p>
<u>Thanks to:</u><br>
General Wrex for helping with scripting<br>
</p>
Change Prefix to:<br>
<textarea id="pprefix" class="round" style="width: 40%; resize: none;" type="textarea" rows="1" cols="20"></textarea><br><br>
</div>`;
},

//---------------------------------------------------------------------
Expand All @@ -94,12 +115,22 @@ init: function() {},
// so be sure to provide checks for variable existance.
//---------------------------------------------------------------------

action: function(cache) {
const data = cache.actions[cache.index];
console.log('Update starts... that may take a while!');
console.log(require('child_process').execSync('npm install --save discord.js@11.3.0'));
console.log('Update finished. Restart DBM and your bot.')
this.callNextAction(cache);
action: function (cache) {
const data = cache.actions[cache.index];

try {

var prefix = this.evalMessage(data.pprefix, cache);
if (prefix) {
this.getDBM().Files.data.settings.tag = prefix;
this.getDBM().Files.saveData("settings", function () { console.log("Prefix changed to " + prefix) });
} else {
console.log(prefix + " is not valid! Try again!");
}
} catch (err) {
console.log("ERROR!" + err.stack ? err.stack : err);
}
this.callNextAction(cache);
},

//---------------------------------------------------------------------
Expand Down
42 changes: 18 additions & 24 deletions actions/update_music_MOD.js → actions/jump_to_action_MOD.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
// This is the name of the action displayed in the editor.
//---------------------------------------------------------------------

name: "Fix music",
name: "Jump to Action",

//---------------------------------------------------------------------
// Action Section
Expand All @@ -23,18 +23,9 @@ section: "Other Stuff",
//---------------------------------------------------------------------

subtitle: function(data) {
return `Fixes music for your bot`;
return `Jump to action ${typeof data.call === 'number' ? "#" : "" + data.call}`;
},


//---------------------------------------------------------------------
// Action Storage Function
//
// Stores the relevant variable info for the editor.
//---------------------------------------------------------------------

//variableStorage: function(data, varType) {},

//---------------------------------------------------------------------
// Action Fields
//
Expand All @@ -43,7 +34,7 @@ subtitle: function(data) {
// are also the names of the fields stored in the action's JSON data.
//---------------------------------------------------------------------

fields: [],
fields: ["call"],

//---------------------------------------------------------------------
// Command HTML
Expand All @@ -65,15 +56,16 @@ html: function(isEvent, data) {
return `
<div>
<p>
<u>Warning:</u><br>
This action updates your ytdl-core version to the latest one.<br>
DBM Mods is not responsible for any lost commands or events!<br>
We suggest you to do an update from your complete mod folder before updating.<br><br>
To update your version simply create a command and add this action.<br>
The update should fix the Play YouTube URL stuff.<br><br>
Check your bot log for the installation log (Project -> Open Bot Log)!
<u>Mod Info:</u><br>
Created by Lasse!
</p>
</div>`
</div><br>
<div>
<div id="varNameContainer" style="float: left; width: 60%;">
Jump to Action:<br>
<input id="call" class="round" type="text">
</div>
</div><br><br><br>`
},

//---------------------------------------------------------------------
Expand All @@ -96,10 +88,12 @@ init: function() {},

action: function(cache) {
const data = cache.actions[cache.index];
console.log('Update starts... that may take a while!');
console.log(require('child_process').execSync('npm install --save ytdl-core@0.19.0'));
console.log('Update finished. Restart DBM and your bot.')
this.callNextAction(cache);
const val = parseInt(this.evalMessage(data.call, cache));
const index = Math.max(val - 1, 0);
if(cache.actions[index]) {
cache.index = index - 1;
this.callNextAction(cache);
}
},

//---------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions actions/mod_info_MOD.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ subtitle: function(data) {
author: "Lasse",

// The version of the mod (Defaults to 1.0.0)
version: "1.8.3",
version: "1.8.4",

// A short description to show on the mod line for this mod (Must be on a single line)
short_description: "Information about the Mod Collection.",
Expand Down Expand Up @@ -94,7 +94,7 @@ html: function(isEvent, data) {
Join the Discord Guild to stay updated and be able to suggest things.<br>
<a href="https://discord.gg/Y4fPBnZ" target="_blank">Join now</a><br>
<u>Your version:</u><br>
1.8.3<br>
1.8.4<br>
<u>Changelog:</u><br>
Click here to see the latest updates:<br>
<a href="https://github.com/Discord-Bot-Maker-Mods/DBM-Mods/releases" target="_blank">Open Changelog</a><br>
Expand Down
3 changes: 2 additions & 1 deletion actions/mod_info_page_2MOD.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ subtitle: function(data) {
author: "Lasse",

// The version of the mod (Defaults to 1.0.0)
version: "1.8.2",
version: "1.8.4",

// A short description to show on the mod line for this mod (Must be on a single line)
short_description: "Information about the Mod Collection",
Expand Down Expand Up @@ -94,6 +94,7 @@ html: function(isEvent, data) {
- MitchDaGamer (5$)<br>
- General Wrex (1$)<br>
- Eggsy (1$)<br>
- Proximity (1$)<br>
<br>
Become a patron today!<br>
<a href="https://www.patreon.com/dbmmods" target="_blank">https://www.patreon.com/dbmmods</a><br>
Expand Down
2 changes: 1 addition & 1 deletion actions/remove_message_reactions_MOD.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ section: "Messaging",
subtitle: function(data) {
const names = ['Command Message', 'Temp Variable', 'Server Variable', 'Global Variable'];
const index = parseInt(data.storage);
return data.storage === "0" ? `Pin ${names[index]}` : `Pin ${names[index]} (${data.varName})`;
return `Remove reactions from Message`;
},

//---------------------------------------------------------------------
Expand Down
Loading

0 comments on commit f5d6217

Please sign in to comment.