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

Function truthCommand

commands/truth.js:3–21  ·  view source on GitHub ↗
(sock, chatId, message)

Source from the content-addressed store, hash-verified

1const fetch = require('node-fetch');
2
3async function truthCommand(sock, chatId, message) {
4 try {
5 const shizokeys = 'shizo';
6 const res = await fetch(`https://shizoapi.onrender.com/api/texts/truth?apikey=${shizokeys}`);
7
8 if (!res.ok) {
9 throw await res.text();
10 }
11
12 const json = await res.json();
13 const truthMessage = json.result;
14
15 // Send the truth message
16 await sock.sendMessage(chatId, { text: truthMessage }, { quoted: message });
17 } catch (error) {
18 console.error('Error in truth command:', error);
19 await sock.sendMessage(chatId, { text: '❌ Failed to get truth. Please try again later!' }, { quoted: message });
20 }
21}
22
23module.exports = { truthCommand };

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected