MCPcopy Create free account
hub / github.com/Slayer128/Carltech-Bot / deleteCmd

Function deleteCmd

lib/stickcmd.js:64–79  ·  view source on GitHub ↗
(cmd)

Source from the content-addressed store, hash-verified

62
63// Function to delete a stickcmd
64async function deleteCmd(cmd) {
65 try {
66 const data = loadStickcmdData();
67
68 // Check if the stickcmd exists
69 if (data[cmd]) {
70 delete data[cmd]; // Remove the stickcmd
71 saveStickcmdData(data);
72 console.log(`Stickcmd ${cmd} has been removed.`);
73 } else {
74 console.log(`Stickcmd ${cmd} does not exist.`);
75 }
76 } catch (error) {
77 console.error('Error while deleting the stickcmd:', error);
78 }
79}
80
81// Function to get the cmd by id
82async function getCmdById(id) {

Callers

nothing calls this directly

Calls 2

loadStickcmdDataFunction · 0.85
saveStickcmdDataFunction · 0.85

Tested by

no test coverage detected