(jid)
| 39 | |
| 40 | // Function to add a sudo number (jid) to the list |
| 41 | async 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 |
| 59 | async function removeSudoNumber(jid) { |
no test coverage detected