MCPcopy Create free account
hub / github.com/GlobalTechInfo/MEGA-MD / handler

Function handler

plugins/roseday.js:7–22  ·  view source on GitHub ↗
(sock, message, args, context)

Source from the content-addressed store, hash-verified

5 description: 'Get a random Rose Day message/quote',
6 usage: '.roseday',
7 async handler(sock, message, args, context) {
8 const chatId = context.chatId || message.key.remoteJid;
9 try {
10 const res = await fetch(`https://api.princetechn.com/api/fun/roseday?apikey=prince`);
11 if (!res.ok) {
12 throw await res.text();
13 }
14 const json = await res.json();
15 const rosedayMessage = json.result;
16 await sock.sendMessage(chatId, { text: rosedayMessage }, { quoted: message });
17 }
18 catch (error) {
19 console.error('RoseDay Command Error:', error);
20 await sock.sendMessage(chatId, { text: '❌ Failed to get Rose Day quote. Please try again later!' }, { quoted: message });
21 }
22 }
23};

Callers

nothing calls this directly

Calls 1

jsonMethod · 0.80

Tested by

no test coverage detected