๐šˆ๐šŠ๐š๐š˜ ๐™ฒ๐š˜๐š๐š’๐š—๐š <ู ู ู >
295 subscribers
3 files
7 links
ุงูƒูˆุงุฏ - ู…ู„ูุงุช - ุณูƒุฑุจุชุงุช - ุงุถุงูุงุช - ู…ูŠุฒุงุช
ูƒู„ ู…ุงูŠุฎุต ุจูˆุชุงุช ุงู„ูˆุงุชุณ
ุงู„ู‚ู†ุงุฉ ุงู„ุฃุณุงุณูŠุฉ :
@Whatsapp_botz
ู‚ู†ุงุฉ ู…ู„ูุงุช ุจูˆุชุงุช :
https://t.me/wa_bots
Download Telegram
Channel name was changed to ยซ๐šˆ๐šŠ๐š๐š˜ ๐™ฒ๐š˜๐š๐š’๐š—๐š <ู ู ู >ยป
ุงู„ุณู„ุงู… ุนู„ูŠูƒู… ูˆุฑุญู…ุฉ ุงู„ู„ู‡ ูˆุจุฑูƒุงุชู‡
โค11
/*
๐Ÿ’Ž ุงู„ู‚ุณู… : [ ุงู„ุนุงุจ ]
๐Ÿ“Œ ุงู„ู…ูŠุฒุฉ : [ ุงุญุฒุฑ ]
๐Ÿท ุงู„ู†ูˆุน : Plugin ESM
โ™ฒ ุงู„ูˆุธูŠูุฉ : ู„ุนุจุฉ ุงุญุฒุฑ ุงุณู… ุงู„ุดุฎุตูŠุฉ
โœ๏ธ ุจูˆุงุณุทุฉ :
https://t.me/YatoCoding
โœ๏ธ ุงู„ุฏุนู… :
https://t.me/alkaser_0_0
*/


ุงู„ูƒูˆุฏ ุงู„ุฃุณุงุณูŠ :
let timeout = 60000
let poin = 500

let handler = async (m, { conn, command, usedPrefix }) => {
conn.tebakbendera = conn.tebakbendera || {}
let id = m.chat

if (id in conn.tebakbendera) {
conn.reply(m.chat, 'โโ”ƒู„ู… ูŠุชู… ุงู„ุงุฌุงุจุฉ ุนู„ูŠ ุงู„ุณุคุงู„ ุจุนุฏโ”ƒโŒ โฏ', conn.tebakbendera[id][0])
throw false
}

// ุฌู„ุจ ุงู„ุจูŠุงู†ุงุช ู…ู† whois.json
let src = await (await fetch('https://github.com/anasmods/Nandimonai/raw/main/game/whois.json')).json()
let json = src[Math.floor(Math.random() * src.length)]

let caption = `*${command.toUpperCase()}*
โโ†žโ”‡ุงู„ู€ูˆู‚ู€ุชโณโ†ž ${(timeout / 1000).toFixed(2)} โ”‡
*ุงุณุชุฎุฏู… ุงู†ุณุญุจ ู„ู„ุฃู†ุณุญุงุจ*
โโ†žโ”‡ุงู„ู€ุฌู€ุงุฆู€ุฒุฉ๐Ÿ’ฐโ†ž ${poin} ู†ู‚ุงุทโ”‡
โžฅ ๐—ฌ๐—ฎ๐˜๐—ผ ๐—•๐—ผ๐˜
`.trim()

// ุฅุฑุณุงู„ ุงู„ุตูˆุฑุฉ ูƒุฑุงุจุท ู…ุจุงุดุฑ
let sentMsg = await conn.sendMessage(m.chat, {
image: { url: json.img },
caption: caption
}, { quoted: m })
// แดแดแด…แด‡ ส™ส : https://t.me/YatoCoding
conn.tebakbendera[id] = [
sentMsg,
json,
poin,
setTimeout(() => {
if (conn.tebakbendera[id]) {
conn.reply(m.chat, `โฎ โŒ›โ”‡ุงู†ุชู‡ูŠ ุงู„ูˆู‚ุชโ”‡โŒ›โฏ\nโโ†žโ”‡ุงู„ุงุฌู€ุงุจู€ุฉโœ…โ†ž ${json.name}โ”‡`, conn.tebakbendera[id][0])
delete conn.tebakbendera[id]
}
}, timeout)
]
}

handler.help = ['ุงุญุฒุฑ']
handler.tags = ['game']
handler.command = /^ุงุญุฒุฑ/i

export default handler

ูƒูˆุฏ ุงู„ู…ุนุงู„ุฌุฉ :

import similarity from 'similarity'
const threshold = 0.72
export async function before(m) {
let id = m.chat
if (!m.quoted || !m.quoted.fromMe || !m.quoted.isBaileys || !m.text || !/ุงุณุชุฎุฏู….*ุงู†ุณุญุจ/i.test(m.quoted.text) || /.*hhint/i.test(m.text))
return !0
this.tebakbendera = this.tebakbendera ? this.tebakbendera : {}
if (!(id in this.tebakbendera))
return this.reply(m.chat, '*ู„ู‚ุฏ ุงู†ุชู‡ูŠ ู‡ุฐุง ุงู„ุณุคุงู„ ุงูƒุชุจ ุงุญุฒุฑ/ุนู„ู…/ุนูŠู† ู„ุชุธู‡ุฑ ุฃุณุฃู„ู‡ ุฌุฏูŠุฏู‡*', m)
if (m.quoted.id == this.tebakbendera[id][0].id) {
let isSurrender = /^(ุงู†ุณุญุจ|surr?ender)$/i.test(m.text)
if (isSurrender) {
clearTimeout(this.tebakbendera[id][3])
delete this.tebakbendera[id]
return this.reply(m.chat, '*ุทู„ุน ูุงุดู„ ูˆ ุงุณุชุณู„ู… :( !*', m)
}
let json = JSON.parse(JSON.stringify(this.tebakbendera[id][1]))
// แดแดแด…แด‡ ส™ส : https://t.me/YatoCoding
if (m.text.toLowerCase() == json.name.toLowerCase().trim()) {
global.db.data.users[m.sender].exp += this.tebakbendera[id][2]
this.reply(m.chat, `*โโ”ƒุงุฌู€ุงุจู€ุฉ ุตู€ุญู€ูŠู€ุญู€ุฉโ”ƒโœ… โฏ*\n\n*โโ†žโ”‡ุงู„ู€ุฌู€ุงุฆู€ุฒุฉ๐Ÿ’ฐโ†ž${this.tebakbendera[id][2]} ู†ู‚ุทู‡*`, m)
clearTimeout(this.tebakbendera[id][3])
delete this.tebakbendera[id]
} else if (similarity(m.text.toLowerCase(), json.name.toLowerCase().trim()) >= threshold)
m.reply(`*ู„ู‚ุฏ ูƒู†ุช ุนู„ูŠ ูˆุดูƒ ุงู„ู†ุฌุงุญ*!`)
else
this.reply(m.chat, `โโ”ƒุงุฌู€ุงุจู€ุฉ ุฎู€ุงุทู€ุฆู€ุฉโ”ƒโŒ โฏ`, m)
}
return !0
}
export const exp = 0
โค3
๐Ÿ’Ž ุงู„ู‚ุณู… : [ ุงู„ุนุงุจ ]
๐Ÿ“Œ ุงู„ู…ูŠุฒุฉ : [ ุนูŠู† ]
๐Ÿท ุงู„ู†ูˆุน : Plugin ESM
โ™ฒ ุงู„ูˆุธูŠูุฉ : ู„ุนุจุฉ ุงู„ุชุนุฑู ุนู„ู‰ ุงู„ุดุฎุตูŠุฉ
โœ๏ธ ุจูˆุงุณุทุฉ :
https://t.me/YatoCoding
โœ๏ธ ุงู„ุฏุนู… :
https://t.me/alkaser_0_0

ุงู„ูƒูˆุฏ ุงู„ุฃุณุงุณูŠ :
let timeout = 60000
let poin = 500

let handler = async (m, { conn, command }) => {
conn.tebakAin = conn.tebakAin ? conn.tebakAin : {}
let id = m.chat
if (id in conn.tebakAin) {
conn.reply(m.chat, 'โโ”ƒู„ู… ูŠุชู… ุงู„ุงุฌุงุจุฉ ุนู„ูŠ ุงู„ุณุคุงู„ ุจุนุฏโ”ƒโŒ โฏ', conn.tebakAin[id].msg)
throw false
}

let src = await (await fetch('https://github.com/anasmods/Nandimonai/raw/main/game/eye.json')).json()
let json = src[Math.floor(Math.random() * src.length)]
let caption = `*${command.toUpperCase()}*
โโ†žโ”‡ุงู„ู€ูˆู‚ู€ุชโณโ†ž ${(timeout / 1000).toFixed(2)} โ”‡
*ุงุณุชุฎุฏู… ุงู†ุณุญุจ ู„ู„ุฃู†ุณุญุงุจ*
โโ†žโ”‡ุงู„ู€ุฌู€ุงุฆู€ุฒุฉ๐Ÿ’ฐโ†ž ${poin} ู†ู‚ุงุทโ”‡
โžฅ ๐—ฌ๐—ฎ๐˜๐—ผ ๐—•๐—ผ๐˜
`.trim()

let msg = await conn.sendMessage(m.chat, { image: { url: json.img }, caption }, { quoted: m })
// แดแดแด…แด‡ ส™ส : https://t.me/YatoCoding
conn.tebakAin[id] = {
msg,
json,
poin,
timeout: setTimeout(() => {
if (conn.tebakAin[id]) {
conn.reply(m.chat, `โฎ โŒ›โ”‡ุงู†ุชู‡ูŠ ุงู„ูˆู‚ุชโ”‡โŒ›โฏ\nโโ†žโ”‡ุงู„ุงุฌู€ุงุจู€ุฉโœ…โ†ž ${json.name}โ”‡`, conn.tebakAin[id].msg)
delete conn.tebakAin[id]
}
}, timeout)
}
}

handler.help = ['ุนูŠู†']
handler.tags = ['games']
handler.command = /^ุนูŠู†/i

export default handler

ูƒูˆุฏ ุงู„ู…ุนุงู„ุฌุฉ :
import similarity from 'similarity'
const threshold = 0.72

export async function before(m) {
let conn = this
conn.tebakAin = conn.tebakAin ? conn.tebakAin : {}
let id = m.chat
if (!(id in conn.tebakAin)) return !0

let game = conn.tebakAin[id]
if (!m.quoted || m.quoted.id !== game.msg.key.id) return !0

let isSurrender = /^(ุงู†ุณุญุจ|surr?ender)$/i.test(m.text)
if (isSurrender) {
clearTimeout(game.timeout)
delete conn.tebakAin[id]
return conn.reply(m.chat, '*ุทู„ุน ูุงุดู„ ูˆ ุงุณุชุณู„ู… :( !*', m)
}
// แดแดแด…แด‡ ส™ส : https://t.me/YatoCoding
let json = game.json
if (m.text.toLowerCase() == json.name.toLowerCase().trim()) {
global.db.data.users[m.sender].exp += game.poin
conn.reply(m.chat, `*โโ”ƒุงุฌู€ุงุจู€ุฉ ุตู€ุญู€ูŠู€ุญู€ุฉโ”ƒโœ… โฏ*\n\n*โโ†žโ”‡ุงู„ู€ุฌู€ุงุฆู€ุฒุฉ๐Ÿ’ฐโ†ž ${game.poin} ู†ู‚ุทู‡*`, m)
clearTimeout(game.timeout)
delete conn.tebakAin[id]
} else if (similarity(m.text.toLowerCase(), json.name.toLowerCase().trim()) >= threshold) {
m.reply(`*ู„ู‚ุฏ ูƒู†ุช ุนู„ู‰ ูˆุดูƒ ุงู„ู†ุฌุงุญ*!`)
} else {
conn.reply(m.chat, `โโ”ƒุงุฌู€ุงุจู€ุฉ ุฎู€ุงุทู€ุฆู€ุฉโ”ƒโŒ โฏ`, m)
}
return !0
}

export const exp = 0
โค6๐Ÿ˜1
ุจูˆุชโ€ŒุนุฑุจูŠ.zip
848.2 KB
ุจูˆุช ุนุฑุจูŠ ุดุบุงู„โœ…

๐Ÿ–ผ ู…ุฏุนูˆู… ุจ ุฃุฒุฑุงุฑ โœ…

ุฑุจุท ุฎุงุฑุฌูŠ (creds.json) ุฏุงุฎู„ ู…ุฌู„ุฏ Taibsessions โœ…

ูŠุญุชุงุฌ ุณูŠุฑูุฑ ู…ุชูˆุณุท โœ…
ููŠู‡ ุจุนุถ ุงู„ุฃุฎุทุงุก ุจุณ ุชู‚ุฏุฑ ุชุนุฏู„ ุนู„ูŠู‡ ุจุฑุงุญุชูƒ ูˆุชุตู„ุญู‡ ุจุงู„ุดูƒู„ ุงู„ูŠ ุชุฑูŠุฏู‡

ุงู„ุจูˆุช ุชุจุน ุจูˆุฏูŠ ุงูˆ ุชุงุฆุจ ู…ุฏุฑูŠ ุดุณู…ู‡

https://t.me/whatsapp_botz
Please open Telegram to view this post
VIEW IN TELEGRAM
silana-lite-ofc-master.zip
517.4 KB
ุณูƒุฑุจุช silana lite

ูŠุฏุนู… ุงู„ู„ุบุฉ ุงู„ุนุฑุจูŠุฉ
๐Ÿ‡พ๐Ÿ‡ช & ุงู„ุงู†ุฌู„ูŠุฒูŠุฉ ๐Ÿ‡ฆ๐Ÿ‡บ

ู‚ุงุจู„ ู„ู„ุชุนุฏูŠู„ ูˆุงู„ุชุทูˆูŠุฑ
โœ”๏ธ

ุฑุจุท ุฏุงุฎู„ูŠ ุดุบุงู„ 100%
โœ”๏ธ :
ุงู„ุทุฑูŠู‚ุฉ โœ”๏ธ :
ุชุฏุฎู„ ุงู„ู…ุฌู„ุฏ ูˆุงู„ู…ู„ู
function/settings.js

ุญุท ุฑู‚ู…ูƒ ููŠ ู…ุชุบูŠุฑ pairingNumber

ุงู„ุงุณูƒุฑุจุช ู„ู„ู…ุทูˆุฑ ุงู„ู…ุบุฑุจูŠ ู†ูˆุฑ ุงู„ุฏูŠู†

https://t.me/whatsapp_botz
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
๐Ÿค”1๐Ÿคฃ1
๐Ÿ’Ž ุงู„ู‚ุณู… : [ ุงู„ุจุญุซ ]
๐Ÿ“Œ ุงู„ู…ูŠุฒุฉ : [ tiktoksearch ]
๐Ÿท ุงู„ู†ูˆุน : Plugin ESM
โ™ฒ ุงู„ูˆุธูŠูุฉ : ุจุญุซ ููŠุฏูŠูˆู‡ุงุช ุชูŠูƒ ุชูˆูƒ
โœ๏ธ ุจูˆุงุณุทุฉ :
https://t.me/YatoCoding
โœ๏ธ ุงู„ุฏุนู… :
https://t.me/alkaser_0_0


ุงู„ูƒูˆุฏ ุงู„ุฃุณุงุณูŠ :
import axios from 'axios';

let sentVideos = new Set(); // ู„ุชุฎุฒูŠู† ุงู„ููŠุฏูŠูˆู‡ุงุช ุงู„ุชูŠ ุชู… ุฅุฑุณุงู„ู‡ุง ู„ุชุฌู†ุจ ุงู„ุชูƒุฑุงุฑ

let handler = async (message, { conn, text }) => {
// ุฅุฑุณุงู„ ุฑุฏ ูุนู„ ุนู†ุฏ ุจุฏุก ุงู„ุจุญุซ
await conn.sendMessage(message.chat, { react: { text: "๐ŸŽฅ", key: message.key } });

// ุงู„ุชุญู‚ู‚ ู…ู† ุฅุฏุฎุงู„ ุงู„ู†ุต
if (!text) {
return await conn.sendMessage(message.chat, { text: "โš ๏ธ *ุงู„ุฑุฌุงุก ุฅุฏุฎุงู„ ุงุณู… ุงู„ููŠุฏูŠูˆ ุฃูˆ ุงู„ู†ุต ุงู„ู…ุทู„ูˆุจ ู„ู„ุจุญุซ ุนู†ู‡.*\n\nู…ุซุงู„: .ุชุตู…ูŠู… ุณูˆุฑุฉ ุงู„ู…ุคู…ู†ูˆู†" });
}

// ุฅุถุงูุฉ ูƒู„ู…ุฉ "ุชุตู…ูŠู…" ู„ู„ู†ุต ุงู„ู…ุฏุฎู„
const query = `ุชุตู…ูŠู… ${text}`;

try {
// ุงู„ุจุญุซ ุนู† ุงู„ููŠุฏูŠูˆ
let { data: response } = await axios.get(`https://apis-starlights-team.koyeb.app/starlight/tiktoksearch?text=${query}`);
let searchResults = response.data;

// ุงู„ุชุญู‚ู‚ ู…ู† ูˆุฌูˆุฏ ู†ุชุงุฆุฌ
if (!searchResults.length) {
return await conn.sendMessage(message.chat, { text: `โš ๏ธ ู„ู… ูŠุชู… ุงู„ุนุซูˆุฑ ุนู„ู‰ ู†ุชุงุฆุฌ ู„ูƒู„ู…ุฉ ุงู„ุจุญุซ: *${query}*` });
}

// ูู„ุชุฑุฉ ุงู„ููŠุฏูŠูˆู‡ุงุช ุงู„ุชูŠ ุชู… ุฅุฑุณุงู„ู‡ุง ุจุงู„ูุนู„
let availableResults = searchResults.filter(result => !sentVideos.has(result.nowm));

// ุฅุฐุง ูƒุงู†ุช ูƒู„ ุงู„ููŠุฏูŠูˆู‡ุงุช ุชู… ุฅุฑุณุงู„ู‡ุง ุจุงู„ูุนู„
if (availableResults.length === 0) {
return await conn.sendMessage(message.chat, { text: "โš ๏ธ ูƒู„ ุงู„ููŠุฏูŠูˆู‡ุงุช ุชู… ุฅุฑุณุงู„ู‡ุง ุจุงู„ูุนู„." });
}

// ุงุฎุชูŠุงุฑ ููŠุฏูŠูˆ ุนุดูˆุงุฆูŠ
let result = availableResults[Math.floor(Math.random() * availableResults.length)];

// ุฅุถุงูุฉ ุงู„ููŠุฏูŠูˆ ุงู„ุฐูŠ ุชู… ุฅุฑุณุงู„ู‡ ุฅู„ู‰ ุงู„ู…ุฌู…ูˆุนุฉ ู„ุชุฌู†ุจ ุชูƒุฑุงุฑู‡
sentVideos.add(result.nowm);

// ุฅุฑุณุงู„ ุงู„ููŠุฏูŠูˆ
await conn.sendMessage(message.chat, {
video: { url: result.nowm }, // ุฑุงุจุท ุงู„ููŠุฏูŠูˆ ุจุฏูˆู† ุนู„ุงู…ุฉ ู…ุงุฆูŠุฉ
caption: `*๐Ÿ”น ุชุตู…ูŠู… ู…ุทู„ูˆุจ ๐Ÿ”น*\n\n๐Ÿ“„ *ุงู„ุนู†ูˆุงู†*: ${result.title}\n๐ŸŒ *ุงู„ุฑุงุจุท*: ${result.link}`
});
} catch (error) {
// ุงู„ุฑุฏ ููŠ ุญุงู„ุฉ ูˆุฌูˆุฏ ุฎุทุฃ
await conn.sendMessage(message.chat, { text: `โš ๏ธ ุญุฏุซ ุฎุทุฃ ุฃุซู†ุงุก ุงู„ุจุญุซ: ${error.message}` });
}
};

handler.help = ['ุชุตู…ูŠู…'];
handler.tags = ['search'];
handler.command = ['ุชุตู…ูŠู…','tiktoksearch'];

export default handler;
โค2
plugin_manager.js
7.2 KB
๐Ÿ’Ž ุงู„ู‚ุณู… : [ owner - dev ]
๐Ÿ“Œ ุงู„ู…ูŠุฒุฉ : [ plugin manager ]
๐Ÿท ุงู„ู†ูˆุน : Plugin ESM
โ™ฒ ุงู„ูˆุธูŠูุฉ : ุงุฏุงุฑุฉ ุงู„ุงุถุงูุงุช ูˆุงู„ู…ูŠุฒุงุช ุจุณู‡ูˆู„ุฉ ูƒู€ (ุงุถุงูุฉ/ุชุนุฏูŠู„/ุญุฐู/ุนุฑุถ/ูƒุดู/ู„ุณุชุฉ/ู…ุนู„ูˆู…ุงุช/ุจุญุซ)
โœ๏ธ ุจูˆุงุณุทุฉ :
https://t.me/YatoCoding
โœ๏ธ ุงู„ุฏุนู… :
https://t.me/alkaser_0_0
๐Ÿ”ฅ3โค2
๐Ÿ’Ž ุงู„ู‚ุณู… : [ AI ]
๐Ÿ“Œ ุงู„ู…ูŠุฒุฉ : [ gemini ]
๐Ÿท ุงู„ู†ูˆุน : Plugin ESM
โ™ฒ ุงู„ูˆุธูŠูุฉ : ู…ุญุงุฏุซุฉ ุงู„ุฐูƒุงุก ุงู„ุงุตุทู†ุงุนูŠ
โœ๏ธ ุจูˆุงุณุทุฉ :
https://t.me/YatoCoding
โœ๏ธ ุงู„ุฏุนู… :
https://t.me/alkaser_0_0

// plugins/gemini.js
// ๐–ค YATO BOT MD - Gemini AI Text Chat ๐Ÿง ๐Ÿ’ฌ

import https from 'https'
import fs from 'fs'

const agent = new https.Agent({ keepAlive: true })

function syncCookies(jar, setCookies = []) {
const list = Array.isArray(setCookies) ? setCookies : [setCookies]
for (const item of list) {
const pair = item.split(';')[0].split('=')
if (pair.length >= 2) {
jar[pair[0].trim()] = pair.slice(1).join('=').trim()
}
}
}
// แดแดแด…แด‡ ส™ส : https://t.me/YatoCoding
const buildCookieString = (jar) => Object.entries(jar).map(([k, v]) => `${k}=${v}`).join('; ')

function cleanText(text) {
if (!text) return ''
text = text.replace(/https?:\/\/[a-z0-9.-]*googleusercontent\.com\/[^\s\n"<>]+/gi, '')
return text
.replace(/&#(\d+);/g, (_, n) => String.fromCodePoint(parseInt(n, 10)))
.replace(/&#x([0-9a-f]+);/gi, (_, h) => String.fromCodePoint(parseInt(h, 16)))
.replace(/&amp;/g, '&')
.replace(/&lt;/g, '<')
.replace(/&gt;/g, '>')
.replace(/&quot;/g, '"')
.replace(/&apos;/g, "'")
.replace(/ /g, ' ')
.trim()
}

function request(url, { method = 'GET', headers = {}, body = null, stream = false } = {}) {
return new Promise((resolve, reject) => {
const u = new URL(url)
const opts = {
hostname: u.hostname,
path: u.pathname + u.search,
method,
headers: body ? { ...headers, 'content-length': Buffer.byteLength(body) } : headers,
agent,
maxHeaderSize: 1048576
}

const req = https.request(opts, res => {
if (stream) return resolve({ res, headers: res.headers })
const chunks = []
res.on('data', c => chunks.push(c))
res.on('end', () => resolve({ text: Buffer.concat(chunks).toString(), headers: res.headers }))
})

req.on('error', reject)
if (body) req.write(body)
req.end()
})
}

async function startSession(cookieStr = null) {
const cookies = {}

if (!cookieStr) {
try {
if (fs.existsSync('cookies.json')) {
const cookieData = JSON.parse(fs.readFileSync('cookies.json', 'utf8'))
if (cookieData && Array.isArray(cookieData.cookies)) {
cookieData.cookies.forEach(c => cookies[c.name] = c.value)
}
}
} catch (err) {
console.error('Failed to load cookies.json:', err.message)
}
} else {
for (const pair of cookieStr.split(';')) {
const idx = pair.indexOf('=')
if (idx > 0) cookies[pair.slice(0, idx).trim()] = pair.slice(idx + 1).trim()
}
}

const pageRes = await request('https://gemini.google.com/app', {
headers: {
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
...(Object.keys(cookies).length > 0 ? { 'cookie': buildCookieString(cookies) } : {})
}
})
syncCookies(cookies, pageRes.headers['set-cookie'])

const cfb2hMatch = pageRes.text.match(/"cfb2h":\s*"(.*?)"/)
const buildLabel = cfb2hMatch ? cfb2hMatch[1] : 'boq_assistant-bard-web-server_20260709.09_p0'

const atMatch = pageRes.text.match(/"SNlM0e":"([^"]+)"/)
const sidMatch = pageRes.text.match(/"FdrFJe":"(-?\d+)"/)
const atToken = atMatch ? atMatch[1] : null
const fSid = sidMatch ? sidMatch[1] : null

const batchRes = await request('https://gemini.google.com/_/BardChatUi/data/batchexecute?rpcids=maGuAc&source-path=%2F&hl=en-US&_reqid=1&rt=c', {
method: 'POST',
headers: {
'content-type': 'application/x-www-form-urlencoded;charset=UTF-8',
'cookie': buildCookieString(cookies)
},
body: 'f.req=[[["maGuAc","[0]",null,"generic"]]]&'
})
syncCookies(cookies, batchRes.headers['set-cookie'])

const sessionId = Array.from({ length: 19 }, () => Math.floor(Math.random() * 10)).join('')

return {
cookies,
buildLabel,
sessionId,
atToken,
fSid,
reqId: Math.floor(Math.random() * 90000) + 10000
}
}

function buildStreamRequest(prompt, metadata, auth) {
const queryParams = new URLSearchParams({ hl: 'en-US', _reqid: String(auth.reqId), rt: 'c' })
if (auth.buildLabel) queryParams.set('bl', auth.buildLabel)
if (auth.fSid) queryParams.set('f.sid', auth.fSid)
else if (auth.sessionId) queryParams.set('f.sid', auth.sessionId)

const payload = [
[prompt, 0, null, null, null, null, 0], ['en-US'],
metadata, null, null, null, [1], 1, null, null, 1, 0, null, null, null, null, null, [[0]], 1,
null, null, null, null, null,
['', '', '', null, null, null, null, null, 0, null, 1, null, null, null, []],
null, null, 1, null, null, null, null, null, null, null,
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20],
1, null, null, null, null, [1]
]

const bodyParams = new URLSearchParams({ 'f.req': JSON.stringify([null, JSON.stringify(payload)]) })
if (auth.atToken) bodyParams.set('at', auth.atToken)
const body = bodyParams.toString()

return {
url: `https://gemini.google.com/_/BardChatUi/data/assistant.lamda.BardFrontendService/StreamGenerate?${queryParams}`,
headers: {
'content-type': 'application/x-www-form-urlencoded;charset=UTF-8',
'x-same-domain': '1',
'origin': 'https://gemini.google.com',
'referer': 'https://gemini.google.com/',
'cookie': buildCookieString(auth.cookies)
},
body
}
}
// แดแดแด…แด‡ ส™ส : https://t.me/YatoCoding
// ------------------- [ Handler ุงู„ุดุงุช ุงู„ู†ุตูŠ ูู‚ุท ] -------------------

const handler = async (m, { conn, text, usedPrefix, command }) => {
if (!text) {
return m.reply(`๐Ÿ’ก *ุทุฑูŠู‚ุฉ ุงู„ุงุณุชุฎุฏุงู…:*\n\nุงูƒุชุจ ุณุคุงู„ูƒ ุจุนุฏ ุงู„ุฃู…ุฑ ู…ุจุงุดุฑุฉุŒ ู…ุซุงู„:\n\`${usedPrefix + command} ุงูƒุชุจ ู„ูŠ ูƒูˆุฏ ุจุงูŠุซูˆู† ุจุณูŠุท\`\n\`${usedPrefix + command} ู…ู† ู‡ูˆ ูŠุงุชูˆุŸ\``)
}

await conn.sendPresenceUpdate('composing', m.chat)

try {
const auth = await startSession()
const metadata = ['', '', '', null, null, null, null, null, null, '']
const req = buildStreamRequest(text, metadata, auth)

const { res } = await request(req.url, { method: 'POST', headers: req.headers, body: req.body, stream: true })

let rawText = ''
let buf = ''

res.on('data', chunk => {
buf += chunk.toString('utf8')
if (buf.startsWith(")]}'")) buf = buf.substring(4).trimStart()

while (true) {
const nl = buf.indexOf('\n')
if (nl === -1) break
const size = parseInt(buf.substring(0, nl).trim(), 10)
if (isNaN(size)) { buf = buf.substring(nl + 1); continue }
if (buf.length < nl + size) break

const framePayload = buf.substring(nl, nl + size)
buf = buf.substring(nl + size)

try {
const frameData = JSON.parse(framePayload)
for (const item of (Array.isArray(frameData) ? frameData : [frameData])) {
const innerStr = item?.[2]
if (!innerStr) continue
const pj = JSON.parse(innerStr)
for (const cand of (pj?.[4] || [])) {
const raw = cand?.[1]?.[0] || ''
if (raw) rawText = raw
}
}
} catch (_) {}
}
})

res.on('end', async () => {
const result = cleanText(rawText)
if (result) {
await m.reply(`๐Ÿง  *Gemini AI:*\n\n${result}`)
} else {
await m.reply('โŒ ู„ู… ุฃุณุชุทุน ุงู„ุญุตูˆู„ ุนู„ู‰ ุฅุฌุงุจุฉุŒ ุญุงูˆู„ ุตูŠุงุบุฉ ุงู„ุณุคุงู„ ุจุดูƒู„ ุขุฎุฑ.')
}
})

} catch (error) {
console.error('Gemini Plugin Error:', error)
await m.reply('โŒ ุญุฏุซ ุฎุทุฃ ุฃุซู†ุงุก ุงู„ุงุชุตุงู„ ุจุงู„ุฐูƒุงุก ุงู„ุงุตุทู†ุงุนูŠ.')
}
}

handler.help = ['gemini <ุณุคุงู„>']
handler.tags = ['ai']
handler.command = /^(ุฌูŠู…ูŠู†ุงูŠ|gemini|ุฌูŠู…ูŠู†ูŠ|ai)$/i

export default handler
โค1