MCPcopy Index your code
hub / github.com/Slayer128/Carltech-Bot / getCmdById

Function getCmdById

lib/stickcmd.js:82–97  ·  view source on GitHub ↗
(id)

Source from the content-addressed store, hash-verified

80
81// Function to get the cmd by id
82async function getCmdById(id) {
83 try {
84 const data = loadStickcmdData();
85
86 // Search for the cmd by id
87 for (const cmd in data) {
88 if (data[cmd].id === id) {
89 return cmd;
90 }
91 }
92 return null; // Return null if not found
93 } catch (error) {
94 console.error('Error while getting the cmd by id:', error);
95 return null;
96 }
97}
98
99// Function to get all stickcmds
100async function getAllStickCmds() {

Callers

nothing calls this directly

Calls 1

loadStickcmdDataFunction · 0.85

Tested by

no test coverage detected