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

Function addSudoNumber

lib/sudo.js:41–56  ·  view source on GitHub ↗
(jid)

Source from the content-addressed store, hash-verified

39
40// Function to add a sudo number (jid) to the list
41async function addSudoNumber(jid) {
42 try {
43 const data = loadSudoData();
44
45 // Check if the jid is already in the sudo list
46 if (!data[jid]) {
47 data[jid] = true; // Mark the jid as sudo
48 saveSudoData(data);
49 console.log(`Phone number ${jid} added to the authorized list.`);
50 } else {
51 console.log(`Phone number ${jid} is already in the authorized list.`);
52 }
53 } catch (error) {
54 console.error("Error adding the phone number to the authorized list:", error);
55 }
56}
57
58// Function to remove a sudo number (jid) from the list
59async function removeSudoNumber(jid) {

Callers 1

6b.jsFile · 0.85

Calls 2

loadSudoDataFunction · 0.85
saveSudoDataFunction · 0.85

Tested by

no test coverage detected