MCPcopy Create free account
hub / github.com/Xchristech2/Zenitsu-Bot / anticallCommand

Function anticallCommand

commands/anticall.js:23–40  ·  view source on GitHub ↗
(sock, chatId, message, args)

Source from the content-addressed store, hash-verified

21}
22
23async function anticallCommand(sock, chatId, message, args) {
24 const state = readState();
25 const sub = (args || '').trim().toLowerCase();
26
27 if (!sub || (sub !== 'on' && sub !== 'off' && sub !== 'status')) {
28 await sock.sendMessage(chatId, { text: '*ANTICALL*\n\n.anticall on - Enable auto-block on incoming calls\n.anticall off - Disable anticall\n.anticall status - Show current status' }, { quoted: message });
29 return;
30 }
31
32 if (sub === 'status') {
33 await sock.sendMessage(chatId, { text: `Anticall is currently *${state.enabled ? 'ON' : 'OFF'}*.` }, { quoted: message });
34 return;
35 }
36
37 const enable = sub === 'on';
38 writeState(enable);
39 await sock.sendMessage(chatId, { text: `Anticall is now *${enable ? 'ENABLED' : 'DISABLED'}*.` }, { quoted: message });
40}
41
42module.exports = { anticallCommand, readState };
43

Callers

nothing calls this directly

Calls 2

readStateFunction · 0.70
writeStateFunction · 0.70

Tested by

no test coverage detected