import crypto from 'crypto'
const flappyHtml = `
๐ฆ FLAPPY BIRD
Skor: 0
ยท
Terbaik: 0
`
export default function flappyBird(ev) {
ev.on({
name: 'flappybird',
cmd: ['flappybird', 'flappy'],
tags: 'Game',
desc: 'Mainkan Flappy Bird inline di chat WhatsApp (tap layar untuk terbang)',
run: async (xp, m) => {
await xp.sendMessage(m.chat, { react: { text: '๐ฆ', key: m.key } })
const payloadData = {
response_id: crypto.randomUUID(),
sections: [
{
view_model: {
primitive: {
__typename: 'GenAIaeacdsnwHtmlPrimitive',
payload: flappyHtml,
trusted_sources: []
},
__typename: 'GenAISingleLayoutViewModel'
}
}
]
}
await xp.relayMessage(
m.chat,
{
messageContextInfo: {
deviceListMetadata: {},
deviceListMetadataVersion: 2,
botMetadata: {}
},
botForwardedMessage: {
message: {
richResponseMessage: {
messageType: 1,
submessages: [{ messageType: 2, messageText: '๐ฆ FLAPPY BIRD ARCADE' }],
unifiedResponse: {
data: Buffer.from(JSON.stringify(payloadData)).toString('base64')
},
contextInfo: {
forwardingScore: 1,
isForwarded: true,
forwardedAiBotMessageInfo: {
botJid: '867051314767696@bot'
},
forwardOrigin: 4
}
}
}
}
},
{}
)
}
})
}