(enabled)
| 25 | } |
| 26 | } |
| 27 | async function writeState(enabled) { |
| 28 | try { |
| 29 | if (HAS_DB) { |
| 30 | await store.saveSetting('global', 'anticall', { enabled: !!enabled }); |
| 31 | } |
| 32 | else { |
| 33 | if (!fs.existsSync('./data')) |
| 34 | fs.mkdirSync('./data', { recursive: true }); |
| 35 | fs.writeFileSync(ANTICALL_PATH, JSON.stringify({ enabled: !!enabled }, null, 2)); |
| 36 | } |
| 37 | } |
| 38 | catch (e) { |
| 39 | console.error('Error writing anticall state:', e); |
| 40 | } |
| 41 | } |
| 42 | export default { |
| 43 | command: 'anticall', |
| 44 | aliases: ['acall', 'callblock'], |