{"id":15046332,"url":"https://github.com/ilsyaa/velixs-md","last_synced_at":"2025-10-26T19:31:19.815Z","repository":{"id":188623836,"uuid":"678679465","full_name":"ilsyaa/velixs-md","owner":"ilsyaa","description":"Whatsapp Api NodeJs","archived":false,"fork":false,"pushed_at":"2023-10-06T14:25:14.000Z","size":24,"stargazers_count":10,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-31T22:51:14.783Z","etag":null,"topics":["baileys","velixs-md","webjs","whatsapp-bot","whatsapp-web"],"latest_commit_sha":null,"homepage":"https://velixs.com/blog/cara-membuat-whatsapp-bot-untuk-real-pemula","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ilsyaa.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-15T05:30:00.000Z","updated_at":"2024-10-22T14:03:32.000Z","dependencies_parsed_at":"2023-08-16T06:31:45.215Z","dependency_job_id":"8787f951-ccb1-4da3-a160-b402d1d4c7c9","html_url":"https://github.com/ilsyaa/velixs-md","commit_stats":null,"previous_names":["ilsyaa/velixs-md"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilsyaa%2Fvelixs-md","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilsyaa%2Fvelixs-md/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilsyaa%2Fvelixs-md/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilsyaa%2Fvelixs-md/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ilsyaa","download_url":"https://codeload.github.com/ilsyaa/velixs-md/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238394323,"owners_count":19464583,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["baileys","velixs-md","webjs","whatsapp-bot","whatsapp-web"],"created_at":"2024-09-24T20:52:59.903Z","updated_at":"2025-10-26T19:31:19.479Z","avatar_url":"https://github.com/ilsyaa.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Whatsapp Multi Session - Menghubungkan Lebih Banyak Sesi Whatsapp dalam 1 Aplikasi\n\nMenghubungkan aplikasi Anda dengan Whatsapp\n\nPustaka ringan untuk whatsapp. Tidak memerlukan Selenium atau browser lainnya.\n\nBerdiri di atas [Baileys](https://github.com/WhiskeySockets/Baileys) Pustaka.\n\n## Installation\n\nInstall package using npm\n\n```\nnpm install velixs-md\n```\n\nKemudian impor kode Anda\n\nGunakan JS Module\n\n```ts\nimport * as whatsapp from \"velixs-md\";\n```\n\natau gunakan CommonJS\n\n```ts\nconst whatsapp = require(\"velixs-md\");\n```\n\n## Session Usage/Examples\n\nStart New Session\n\n```ts\n// buat sesi dengan ID : ilsyaganz\n\nconst session = await whatsapp.startSession(\"ilsya\");\n// Kemudian, pindai QR di terminal\n```\n\nGet All Session ID\n\n```ts\nconst sessions = whatsapp.getAllSession();\n// mengembalikan semua ID sesi yang telah dibuat\n```\n\nGet Session Data By ID\n\n```ts\nconst session = whatsapp.getSession(\"ilsya\");\n// mengembalikan data sesi\n```\n\nLoad Session From Storage / Load Saved Session\n\n```ts\nwhatsapp.loadSessionsFromStorage();\n// Mulai sesi tersimpan tanpa memindai lagi\n```\n\n## Messaging Usage/Examples\n\nSend Text Message\n\n```ts\nawait whatsapp.sendTextMessage({\n  sessionId: \"ilsya\", // session ID\n  to: \"6281234567890\", // always add country code (ex: 62)\n  text: \"Hi There, This is Message from Server!\", // message you want to send\n});\n```\n\nSend Image\n\n```ts\nconst image = fs.readFileSync(\"./myimage.png\"); // return Buffer\nconst send = await whatsapp.sendImage({\n  sessionId: \"ilsya\",\n  to: \"6281234567890\",\n  text: \"My Image Caption\",\n  media: image, // can from URL too\n});\n```\n\nSend Video\n\n```ts\nconst video = fs.readFileSync(\"./video.mp4\"); // return Buffer\nconst send = await whatsapp.sendVideo({\n  sessionId: \"ilsya\",\n  to: \"6281234567890\",\n  text: \"My Video Caption\",\n  media: video, // can from URL too\n});\n```\n\nSend Document File\n\n```ts\nconst filename = \"file.pdf\";\nconst document = fs.readFileSync(filename); // return Buffer\nconst send = await whatsapp.sendDocument({\n  sessionId: \"ilsya\",\n  to: \"6281234567890\",\n  filename: filename,\n  media: document,\n  text: \"Hei, Check this Document\",\n});\n```\n\nRead a Message\n\n```ts\nawait whatsapp.readMessage({\n  sessionId: \"ilsya\",\n  key: msg.key,\n});\n```\n\nSend Typing Effect\n\n```ts\nawait whatsapp.sendTyping({\n  sessionId: \"ilsya\",\n  to: \"6281234567890\",\n  duration: 3000,\n});\n```\n\n## Listener Usage/Examples\n\nAdd Listener/Callback When Receive a Message\n\n```ts\nwhatsapp.onMessageReceived((msg) =\u003e {\n  console.log(`New Message Received On Session: ${msg.sessionId} \u003e\u003e\u003e`, msg);\n});\n```\n\nAdd Listener/Callback When QR Printed\n\n```ts\nwhatsapp.onQRUpdated(({ sessionId, qr }) =\u003e {\n  console.log(qr);\n});\n```\n\nAdd Listener/Callback When Session Connected\n\n```ts\nwhatsapp.onConnected((sessionId) =\u003e {\n  console.log(\"session connected :\" + sessionId);\n});\n```\n\n## Handling Incoming Message Examples\n\n```ts\nwhatsapp.onMessageReceived(async (msg) =\u003e {\n  if (msg.key.fromMe || msg.key.remoteJid.includes(\"status\")) return;\n  await whatsapp.readMessage({\n    sessionId: msg.sessionId,\n    key: msg.key,\n  });\n  await whatsapp.sendTyping({\n    sessionId: msg.sessionId,\n    to: msg.key.remoteJid,\n    duration: 3000,\n  });\n  await whatsapp.sendTextMessage({\n    sessionId: msg.sessionId,\n    to: msg.key.remoteJid,\n    text: \"Hello!\",\n    answering: msg, // for quoting message\n  });\n});\n```\n\n## Save Media Message (Image, Video, Document)\n\n```ts\nwa.onMessageReceived(async (msg) =\u003e {\n  if (msg.message?.imageMessage) {\n    // save image\n    msg.saveImage(\"./image.jpg\");\n  }\n\n  if (msg.message?.videoMessage) {\n    // save video\n    msg.saveVideo(\"./video.mp4\");\n  }\n\n  if (msg.message?.documentMessage) {\n    // save document\n    msg.saveDocument(\"./file\"); // without extension\n  }\n});\n```\n\n## Optional Configuration Usage/Examples\n\nSet custom credentials directory\n\n```ts\n// default dir is \"wa_credentials\"\nwhatsapp.setCredentialsDir(\"my_custom_dir\");\n// or : credentials/mycreds\n```\n\nSet custom Browser\n```ts\n// default browser is VelixS\nwhatsapp.setBrowser(\"macOS\");\n// or : custom your name\n```\n\n## Authors\n\n- [@ilsyaa](https://www.github.com/ilsyaa)\n\n## Feedback or Support\n\nIf you have any feedback or support, please reach out to me at ilsya@velixs.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filsyaa%2Fvelixs-md","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filsyaa%2Fvelixs-md","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filsyaa%2Fvelixs-md/lists"}