Repository navigation
Home
Create Custom History
A single-file WhatsApp group-history builder for Baileys.
English | Bahasa Indonesia | العربية (مصر) | Português (Brasil) | हिन्दी (भारत) | Bahasa Melayu (Malaysia)
Documentation: Full documentation is available in the language selector above.
CFC-CCH (Create Custom History) is a single-file library for creating and sending custom WhatsApp group-history bundles through Baileys.
It supports text, image, raw messages, and message reactions with custom senders, timestamps, and quoted messages.
Important: Read Group history requirements before using CFC-CCH. The target's join session and timestamps determine whether the history is shown.
- Node.js 20+
@whiskeysockets/baileys
Copy cFC.js into your project.
import { CFC } from './cFC.js'const cfc = new CFC(sock)
const b = cfc.builder()
const m1 = b.addText('selamat datang', {
participant: '0@s.whatsapp.net',
timestamp: 1792914860
})
const m2 = b.addText('omaga sepuh', {
participant: '11111111@s.whatsapp.net',
timestamp: 1792914861,
quoted: m1
})
await b.send(m.chat, targetJid)send(groupJid, targetJid) sends the bundle to the group and addresses the history to the target.
Required:
participant
timestampOptional:
fromMe
messageId
pushNamefromMe, participant, messageId, and timestamp are stored outside message.
fromMe belongs in key.fromMe.
b.addText('halo', {
participant: '0@s.whatsapp.net',
timestamp: 1792914860,
fromMe: false
})b.addText('gw juga', {
participant: targetJid,
timestamp: 1792914861,
fromMe: true
})participant is still required when fromMe is true.
Group-history rendering may place fromMe: true and fromMe: false differently depending on the target client. Test the desired combination on the target device.
const m1 = b.addText('halo', {
participant: '0@s.whatsapp.net',
timestamp: 1792914860
})With optional fields:
const m1 = b.addText('halo', {
participant: '0@s.whatsapp.net',
timestamp: 1792914860,
fromMe: false,
messageId: '3EB0CUSTOMID123',
pushName: 'Nama'
})Add a reaction to a message with addReaction().
const m = b.addText('halo', {
participant: '0@s.whatsapp.net',
timestamp: 1792914860
})
b.addReaction(m, '👍', {
participant: '6285899292940@s.whatsapp.net',
timestamp: 1792914861
})Reaction by message ID:
b.addReaction('3EB0CUSTOMID123', '👍', {
participant: '6285899292940@s.whatsapp.net',
timestamp: 1792914861
})Chain style:
const m = b.addText('halo', {
participant: '0@s.whatsapp.net',
timestamp: 1792914860
}).addReaction('👍', {
participant: '6285899292940@s.whatsapp.net',
timestamp: 1792914861
})Reaction fields:
participant // reactor
timestamp // reaction time, Unix seconds
fromMe // optional, default false
messageId // optional reaction key IDThe target message must already be in the builder.
The image helper accepts a local path, URL, Buffer, or prepared imageMessage.
const img = await b.addImage('C:/images/foto.jpg', {
participant: '0@s.whatsapp.net',
timestamp: 1792914862,
caption: 'nih fotonya'
})const img = await b.addImage('https://example.com/foto.jpg', {
participant: '6285899292940@s.whatsapp.net',
timestamp: 1792914863,
caption: 'foto dari internet'
})const img = await b.addImage(buffer, {
participant: '0@s.whatsapp.net',
timestamp: 1792914864
})const img = await b.addImage(imageMessage, {
participant: '0@s.whatsapp.net',
timestamp: 1792914865
})const m1 = b.addRaw({
participant: '0@s.whatsapp.net',
timestamp: 1792914860,
fromMe: false,
messageId: '3EB0CUSTOMID123',
pushName: 'Nama',
message: {
conversation: 'halo'
}
})messageId is optional. If omitted, CFC-CCH generates one.
A custom message ID can be used as a quote target:
b.addText('balas', {
participant: '11111111@s.whatsapp.net',
timestamp: 1792914861,
quoted: '3EB0CUSTOMID123'
})quoted accepts:
const m1 = b.addText('halo', { ... })
b.addText('balas', {
...,
quoted: m1
})const m1 = b.addText('halo', { ... })
b.addText('balas', {
...,
quoted: m1.key.id
})When the ID belongs to a message in the builder, CFC-CCH resolves the participant and quoted message automatically.
b.addText('balas', {
...,
quoted: {
key: {
remoteJid: m.chat,
fromMe: false,
id: '3EB0ABC...',
participant: '0@s.whatsapp.net'
},
message: {
conversation: 'halo'
}
}
})b.addText('balas', {
...,
quoted: {
id: '3EB0ABC...',
participant: '0@s.whatsapp.net',
message: {
conversation: 'halo'
}
}
})A Baileys m.quoted object can also be passed directly.
Builder methods can be chained.
const m1 = new CFC(sock)
.builder()
.addText('halo', {
participant: '0@s.whatsapp.net',
timestamp: 1792914860
})
await m1
.addText('balas', {
participant: '11111111@s.whatsapp.net',
timestamp: 1792914861,
quoted: m1.key.id
})
.send(m.chat, targetJid)Available on a message object:
m1.addText()
m1.addImage()
m1.addRaw()
m1.addReaction()
m1.send()
m1.builder- The target must be in the group when the bundle is sent.
- Timestamps must fall in a period when the target was not in the group.
- New member: after group creation, before joining.
- Rejoin: during the period the target was absent.
- Original member: no new join event, so history may not appear.
- A join session should receive one bundle.
- Before resending for the same join session, delete or revoke the previous bundle and its notice.
- If deduplication persists, the target must leave and rejoin, or a new group must be used.
const cfc = new CFC(sock)
const b = cfc.builder()
b.addText(text, options)
await b.addImage(source, options)
b.addRaw(options)
b.addReaction(target, emoji, options)
b.build()
await b.send(groupJid, targetJid)Required:
participant
timestampOptional:
fromMe
messageId
pushName
quoted- Reactions are handled with
addReaction(). - Sticker helpers are not included; use
addRawwithstickerMessage. - Unofficial library. WhatsApp protocol changes may break it.
Use CFC-CCH only with accounts, groups, and recipients you own or have permission to use.
Personal and educational use only. Resale, paid redistribution, or commercial distribution is not permitted without prior written permission from the author.
Made by popioo