Grab

by @themondon Jul 27, 2025 23:03 Text Command Approved
Posted by @themondon at 7/27/2025 (1 year ago)
Updated at 7/28/2025 (1 year ago)
1 Upvotes
0 Downvotes
1 Net Score

Details

Type: Text Command
DBM Version: 2.1.7 (latest)
Visibility: Public
Required Mods: No

Description

This was originally created by General Wrex.

It goes through the bot commands and sends a list with [p]grab.

When you use [p]grab [command] it sends a json file of the raw data.

For any command you do not want listed, edit the rawdata and append PRIVATE to the front of it. (Do this at least for your HTML categories)

It sends the following message:

Here are the public commands.

Commands:

[Command List]

Events:

[Event List]

Raw Data (JSON)

JSON Data
{"name":"grab","permissions":"NONE","restriction":"1","_id":"oOCvJ","actions":[{"info":"1","infoIndex":"1","storage":"1","varName":"rawdataName","name":"Store Command Params"},{"condition":"0","comparison":"2","value":"0","iftrue":"0","iftrueVal":"","iffalse":"3","iffalseVal":"3","name":"Check Parameters"},{"title":"Requested Rawdata Information","author":"General Wrex","color":"","timestamp":"true","url":"","authorIcon":"","imageUrl":"","thumbUrl":"","storage":"1","varName":"embed","name":"Create Embed Message"},{"behavior":"0","interpretation":"1","code":"try{\n    const name = tempVars(\"rawdataName\");\n    const datas =  Files.data.commands.concat(Files.data.events);\n\n    const rawdata = datas.find(data => data && data.name == name);\n\n    if(rawdata && rawdata.name){\n        const fileName = `${rawdata.name}_${rawdata._id}_rawdata.json`;\n        const file = Buffer.from(JSON.stringify(rawdata, null, 2));  \n\ntempVars(\"embed\").setDescription(`Rawdata requested: \n \n**Name** \\`'${rawdata.name}'\\`\n**Type** \\`${rawdata[\"event-type\"] ? \"Event\" : \"Command\"}\\`\n**Action Count**: \\`${rawdata.actions.length}\\`\n**Event ID**: \\`${rawdata._id}\\`\n\nEnjoy!\n`)\n\nmsg.channel.send({ \n             embed: tempVars(\"embed\"),\n             files: [\n                {   \n                    name: fileName, \n                    attachment: file \n                }\n            ] \n        });\n    }else{\n        msg.channel.send(`The requested data '${name}' does not exist!`);\n    }\n  }catch(error){ console.error(error);}","storage":"0","varName":"","name":"Run Script"},{"name":"End Action Sequence"},{"behavior":"1","interpretation":"1","code":"let rawdatas = \"\";\n    for (var index in Files.data.commands) {\n        var rawdata = Files.data.commands[index];\n        if (rawdata && rawdata.name && !rawdata.name.startsWith(\"|\") && rawdata._id && !rawdata._id.startsWith(\"PRIVATE\") && !rawdata.name.startsWith(\"<div\")) {\n            rawdatas += \"`\" + rawdata.name + \"`, \";\n        }\n    }\nlet commands = rawdatas;\n    rawdatas = \"\";\n    for (var index in Files.data.events) {\n        var rawdata = Files.data.events[index];\n        if (rawdata && rawdata.name && !rawdata.name.startsWith(\"|\") && rawdata._id && !rawdata._id.startsWith(\"PRIVATE\") && !rawdata.name.startsWith(\"<div\")) {\n            rawdatas += \"`\" + rawdata.name + \"`, \";\n        }\n    }\n    let events = rawdatas;\n\nlet bool = false;\n(`Here are the public commands.. \\r\\n \nCommands:\n${commands}\\n\nEvents:\n${events}`).match(/[\\s\\S]{1,2000}/g).forEach((e) => (e.split(','.length - 1) % 2) ? (bool = false) && msg.channel.send(e): (bool = true) && msg.channel.send(e) );","storage":"0","varName":"","name":"Run Script"}],"comType":"0","_aliases":[]}