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

Function githubCommand

commands/github.js:6–78  ·  view source on GitHub ↗
(sock, chatId, message)

Source from the content-addressed store, hash-verified

4const path = require('path');
5
6async function githubCommand(sock, chatId, message) {
7 try {
8 const res = await fetch('https://api.github.com/repos/Xchristech2/Zenitsu-Bot');
9 if (!res.ok) throw new Error('Error fetching repository data');
10 const json = await res.json();
11
12 const txt = `
13╭━━━〔 ⚡ Z E N I T S U • G I T H U B ⚡ 〕━━━╮
14┃ 📦 Repo: ${json.name}
15┃ 🌐 Link: ${json.html_url}
16╰━━━━━━━━━━━━━━━━━━━━━━━╯
17
18⚡ *REPOSITORY STATS*
19╭──────────────
20│ ⭐ Stars : ${json.stargazers_count}
21│ 🍴 Forks : ${json.forks_count}
22│ 👀 Watchers : ${json.watchers_count}
23│ 💾 Size : ${(json.size / 1024).toFixed(2)} MB
24│ 🕒 Updated : ${moment(json.updated_at).format('DD/MM/YY - HH:mm')}
25╰──────────────
26
27⚔️ *POWER NOTE*
28“Code fast… strike faster ⚡”
29
30╭━━━〔 ⚡ DEV INFO ⚡ 〕━━━╮
31┃ 👑 Owner: Chris Gaaju
32┃ 🤖 Bot: Zenitsu Bot
33┃ 🚀 Version: 4.0
34╰━━━━━━━━━━━━━━━━━━━━━━━╯
35`;
36
37 const imgPath = path.join(__dirname, '../assets/bot_repo.jpg');
38
39 if (fs.existsSync(imgPath)) {
40 const imgBuffer = fs.readFileSync(imgPath);
41
42 await sock.sendMessage(chatId, {
43 image: imgBuffer,
44 caption: txt,
45 contextInfo: {
46 forwardingScore: 1,
47 isForwarded: true,
48 forwardedNewsletterMessageInfo: {
49 newsletterJid: '120363406588763460@newsletter',
50 newsletterName: '⚡ Zenitsu Updates',
51 serverMessageId: -1
52 }
53 }
54 }, { quoted: message });
55
56 } else {
57 await sock.sendMessage(chatId, {
58 text: txt,
59 contextInfo: {
60 forwardingScore: 1,
61 isForwarded: true,
62 forwardedNewsletterMessageInfo: {
63 newsletterJid: '120363406588763460@newsletter',

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected