Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import crypto from 'node:crypto'
- /** @param {import('../../core/type/plugin.js').HandlerParams} */
- async function plugin({ sock, jid, text, m, q, prefix, command, other }) {
- /* dapetin dulu semua lid di grup, ini adalah bekal senjata lu buat hidetag
- ini adalah cara gw, yap gw groupMetadatanya langsung konek ke socket,
- jadi kalau buat dapetin all member lids cukup gw ambil dari socket,
- gw yakin tiap sc beda" cara simpen cache metadatanya, gw serahin ke lu
- masing masing".. intinya variabel allMemberLid berisi array of string
- kaya ini [1213@lid, 113242@lid, dst...]
- */
- const gm = await sock.ws.config.cachedGroupMetadata(jid)
- const allMemberLid = gm.participants.map(m => m.id)
- // main code, lu cuma peduli 1 function ini
- await sock.relayMessage(jid, {
- messageContextInfo: {
- messageSecret: crypto.randomBytes(32).toString("base64") // isinya kayak gini kita kira, lu bs pakek apa aja, gw import crypto "SvNuWDSXOMsnm6kO2p0EL8KRm48iECIJfdrwpjAo7EE="
- },
- pollCreationMessageV3: {
- contextInfo: {
- mentionedJid: allMemberLid // yg gw bilang tadi, array of string yg isinya lid yg mau lu hide tag
- },
- options: [
- {
- optionName: "worek.. jangan ht lagi 😡"
- },
- {
- optionName: "enggak"
- }
- ],
- name: "ges maaf HT T^T cuma mau coba poll ht nya work kah?", // judul poling lu
- selectableOptionsCount: 1 // 0 = bisa pilih banyak opsi, 1 = hanya boleh pilih 1 opsi
- }
- }, {
- // gw gak tau ini apa, wajib isi, kalau gk isi ya gk muncul polling nyah :v
- additionalNodes: [{
- tag: 'meta',
- attrs: {
- polltype: 'creation'
- }
- }]
- })
- // dah gitu aja
- }
- plugin.title = 'ht polling'
- plugin.command = ['htpoll']
- plugin.category = ['?']
- plugin.description = 'tutorial hidetag polling'
- export default plugin
Comments
-
- htpoll
-
- // tutor messageId biar keliatan dari desktop
- // seperti biasa, variabel sock dan jid di sesuaikan ✨
- await sock.sendMessage(jid,
- {text: "inspect me.. iam from desktop"},
- {messageId : "3F" + crypto.randomUUID().replaceAll('-','').slice(0,18).toUpperCase()})
Add Comment
Please, Sign In to add comment