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

Function removeSudoNumber

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

Source from the content-addressed store, hash-verified

57
58// Function to remove a sudo number (jid) from the list
59async function removeSudoNumber(jid) {
60 try {
61 const data = loadSudoData();
62
63 // Check if the jid exists in the sudo list
64 if (data[jid]) {
65 delete data[jid]; // Remove the jid
66 saveSudoData(data);
67 console.log(`Phone number ${jid} removed from the authorized list.`);
68 } else {
69 console.log(`Phone number ${jid} is not in the authorized list.`);
70 }
71 } catch (error) {
72 console.error("Error removing the phone number from the authorized list:", error);
73 }
74}
75
76// Function to get all sudo numbers (jids)
77async function getAllSudoNumbers() {

Callers 1

6b.jsFile · 0.85

Calls 2

loadSudoDataFunction · 0.85
saveSudoDataFunction · 0.85

Tested by

no test coverage detected