wolfyflutter

wacap ht poll

Feb 12th, 2026
263
1
Never
3
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 2.07 KB | Source Code | 1 0
  1.  
  2. import crypto from 'node:crypto'
  3.  
  4. /** @param {import('../../core/type/plugin.js').HandlerParams} */
  5.  
  6. async function plugin({ sock, jid, text, m, q, prefix, command, other }) {
  7.  
  8.  
  9.     /* dapetin dulu semua lid di grup, ini adalah bekal senjata lu buat hidetag
  10.        ini adalah cara gw, yap gw groupMetadatanya langsung konek ke socket,
  11.        jadi kalau buat dapetin all member lids cukup gw ambil dari socket,
  12.        gw yakin tiap sc beda" cara simpen cache metadatanya, gw serahin ke lu
  13.        masing masing".. intinya variabel allMemberLid berisi array of string
  14.        kaya ini [1213@lid, 113242@lid, dst...]
  15.     */
  16.  
  17.     const gm = await sock.ws.config.cachedGroupMetadata(jid)
  18.     const allMemberLid = gm.participants.map(m => m.id)
  19.  
  20.     // main code, lu cuma peduli 1 function ini
  21.     await sock.relayMessage(jid, {
  22.         messageContextInfo: {
  23.             messageSecret: crypto.randomBytes(32).toString("base64") // isinya kayak gini kita kira, lu bs pakek apa aja, gw import crypto "SvNuWDSXOMsnm6kO2p0EL8KRm48iECIJfdrwpjAo7EE="
  24.         },
  25.         pollCreationMessageV3: {
  26.             contextInfo: {
  27.                 mentionedJid: allMemberLid // yg gw bilang tadi, array of string yg isinya lid yg mau lu hide tag
  28.             },
  29.  
  30.             options: [
  31.                 {
  32.                     optionName: "worek.. jangan ht lagi 😡"
  33.                 },
  34.                 {
  35.                     optionName: "enggak"
  36.                 }
  37.             ],
  38.             name: "ges maaf HT T^T cuma mau coba poll ht nya work kah?", // judul poling lu
  39.             selectableOptionsCount: 1 // 0 = bisa pilih banyak opsi, 1 = hanya boleh pilih 1 opsi
  40.         }
  41.     }, {
  42.         // gw gak tau ini apa, wajib isi, kalau gk isi ya gk muncul polling nyah :v
  43.         additionalNodes: [{
  44.             tag: 'meta',
  45.             attrs: {
  46.                 polltype: 'creation'
  47.             }
  48.         }]
  49.     })
  50.  
  51.     // dah gitu aja
  52. }
  53.  
  54. plugin.title = 'ht polling'
  55. plugin.command = ['htpoll']
  56. plugin.category = ['?']
  57. plugin.description = 'tutorial hidetag polling'
  58.  
  59. export default plugin
Tags: wacap
Comments
  • Sixseveen
    253 days
    # text 2.07 KB | 0 0
    1. import crypto from 'node:crypto'
    2.  
    3. /** @param {import('../../core/type/plugin.js').HandlerParams} */
    4.  
    5. async function plugin({ sock, jid, text, m, q, prefix, command, other }) {
    6.  
    7.  
    8. /* dapetin dulu semua lid di grup, ini adalah bekal senjata lu buat hidetag
    9. ini adalah cara gw, yap gw groupMetadatanya langsung konek ke socket,
    10. jadi kalau buat dapetin all member lids cukup gw ambil dari socket,
    11. gw yakin tiap sc beda" cara simpen cache metadatanya, gw serahin ke lu
    12. masing masing".. intinya variabel allMemberLid berisi array of string
    13. kaya ini [1213@lid, 113242@lid, dst...]
    14. */
    15.  
    16. const gm = await sock.ws.config.cachedGroupMetadata(jid)
    17. const allMemberLid = gm.participants.map(m => m.id)
    18.  
    19. // main code, lu cuma peduli 1 function ini
    20. await sock.relayMessage(jid, {
    21. messageContextInfo: {
    22. messageSecret: crypto.randomBytes(32).toString("base64") // isinya kayak gini kita kira, lu bs pakek apa aja, gw import crypto "SvNuWDSXOMsnm6kO2p0EL8KRm48iECIJfdrwpjAo7EE="
    23. },
    24. pollCreationMessageV3: {
    25. contextInfo: {
    26. mentionedJid: allMemberLid // yg gw bilang tadi, array of string yg isinya lid yg mau lu hide tag
    27. },
    28.  
    29. options: [
    30. {
    31. optionName: "worek.. jangan ht lagi 😡"
    32. },
    33. {
    34. optionName: "enggak"
    35. }
    36. ],
    37. name: "ges maaf HT T^T cuma mau coba poll ht nya work kah?", // judul poling lu
    38. selectableOptionsCount: 1 // 0 = bisa pilih banyak opsi, 1 = hanya boleh pilih 1 opsi
    39. }
    40. }, {
    41. // gw gak tau ini apa, wajib isi, kalau gk isi ya gk muncul polling nyah :v
    42. additionalNodes: [{
    43. tag: 'meta',
    44. attrs: {
    45. polltype: 'creation'
    46. }
    47. }]
    48. })
    49.  
    50. // dah gitu aja
    51. }
    52.  
    53. plugin.title = 'ht polling'
    54. plugin.command = ['htpoll']
    55. plugin.category = ['?']
    56. plugin.description = 'tutorial hidetag polling'
    57.  
    58. export default plugin
  • Sixseveen
    253 days
    # text 0.01 KB | 0 0
    1. htpoll
  • Sixseveen
    253 days
    # text 0.26 KB | 0 0
    1. // tutor messageId biar keliatan dari desktop
    2. // seperti biasa, variabel sock dan jid di sesuaikan ✨
    3.  
    4. await sock.sendMessage(jid,
    5. {text: "inspect me.. iam from desktop"},
    6. {messageId : "3F" + crypto.randomUUID().replaceAll('-','').slice(0,18).toUpperCase()})
Add Comment
Please, Sign In to add comment