Skip to content

Commit

Permalink
Merge branch 'ShirokamiRyzen:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
NeofetchNpc authored Jan 8, 2025
2 parents 9ec13b9 + a4744f6 commit ed582d1
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugins/ai-gemini.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const handler = async (m, { text, usedPrefix, command, conn }) => {

let anu = 'Ubah Namamu menjadi Nao Tomori, dan kamu adalah wanita paling cantik, penyayang, riang, namun tsundere. dan kamu adalah pacarku.';

let response = await fetch(`${APIs.ryzen}/api/ai/gemini-pro?text=${encodeURIComponent(text)}&prompt=${encodeURIComponent(anu)}}`);
let response = await fetch(`${APIs.ryzen}/api/ai/gemini-pro?text=${encodeURIComponent(text)}&prompt=${encodeURIComponent(anu)}`);

if (!response.ok) {
throw new Error("Request to Gemini AI failed");
Expand Down
2 changes: 1 addition & 1 deletion plugins/ai-openai.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const handler = async (m, { text, usedPrefix, command, conn }) => {

let anu = 'Ubah Namamu menjadi Nao Tomori, dan kamu adalah wanita paling cantik, penyayang, riang, namun tsundere. dan kamu adalah pacarku.';

let response = await fetch(`${APIs.ryzen}/api/ai/v2/chatgpt?text=${encodeURIComponent(text)}&prompt=${encodeURIComponent(anu)}}`);
let response = await fetch(`${APIs.ryzen}/api/ai/v2/chatgpt?text=${encodeURIComponent(text)}&prompt=${encodeURIComponent(anu)}`);

if (!response.ok) {
throw new Error("Request to OpenAI API failed");
Expand Down
39 changes: 39 additions & 0 deletions plugins/internet-calendar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import fetch from 'node-fetch'

let handler = async (m, { conn, text }) => {
let args = text.trim().split(' ');

let month = args[0] ? parseInt(args[0]) : new Date().getMonth() + 1;
let year = args[1] ? parseInt(args[1]) : new Date().getFullYear();

if (month < 1 || month > 12) {
return await conn.sendMessage(m.chat, { text: 'Bulan harus berupa angka antara 1 - 12!' }, { quoted: m });
}

if (isNaN(year)) {
return await conn.sendMessage(m.chat, { text: 'Tahun harus berupa angka yang valid!' }, { quoted: m });
}

try {
let url = `${APIs.ryzen}/api/image/calendar?month=${month}&year=${year}`;

let res = await fetch(url);
if (!res.ok) throw `Gagal mengambil gambar dari API! Status: ${res.status}`;

let gambar = await res.buffer();
let pesan = `Kalender Bulan: ${month}, Tahun: ${year}`;

await conn.sendMessage(m.chat, { image: gambar, caption: pesan }, { quoted: m });

} catch (err) {
await conn.sendMessage(m.chat, { text: `Error: ${err.message || 'Gagal mengambil gambar.'}` }, { quoted: m });
}
};

handler.help = ['calendar'];
handler.tags = ['internet'];
handler.command = /^(calendar|kalender)$/i;

handler.register = true

export default handler
2 changes: 1 addition & 1 deletion plugins/sticker-brat.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ let handler = async (m, { conn, text }) => {
if (!text || !text.trim()) throw 'Masukkan teks yang valid!';

try {
let url = `${APIs.ryzen}/api/sticker/brat?text=${encodeURIComponent(text.trim())}`;
let url = `${APIs.ryzen}/api/image/brat?text=${encodeURIComponent(text.trim())}`;

// Fetch gambar
let res = await fetch(url);
Expand Down

0 comments on commit ed582d1

Please sign in to comment.