
Security News
Oxlint Introduces Type-Aware Linting Preview
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.
hut-chat-api
Advanced tools
A Facebook chat API that doesn't rely on XMPP and This new Logined and get the seqID ( CC PROJECTS AND CHATBOT COMMUNITY )
Here is a redesigned version of your README.md
for the Facebook Chat API with an exclusive look, admin link at the top, and suggestions for icons and SVGs to enhance its appearance:
A new Facebook Chat API for bots and automation! and some changes update code hehe.🚀
If you want to use hut-chat-api
, run this command:
npm install hut-chat-api
This will download hut-chat-api
from NPM repositories.
To test new features or submit bug reports using the latest version from GitHub, use this command:
npm i hut-chat-api
To test your bots without creating a new Facebook account, use Facebook Whitehat Accounts.
Use this this Website to Get your Cookies login less logout or dimiss i think so its depends your account bot how to manage to prevent caught by meta as bot account
Cookies getter Website CC PROJECTS .
const login = require("hut-chat-api");
login({email: "FB_EMAIL", password: "FB_PASSWORD"}, (err, api) => {
if(err) return console.error(err);
api.listen((err, message) => {
api.sendMessage(message.body, message.threadID);
});
});
Here's how it looks when your bot responds:
api.sendMessage(message, threadID, [callback], [messageID])
Messages can be:
body
to the desired message.sticker
to the sticker ID.attachment
to a readable stream or array of streams.url
to the desired URL.emoji
and emojiSize
(small
, medium
, large
).Example: Sending a Basic Message
const login = require("hut-chat-api");
login({email: "FB_EMAIL", password: "FB_PASSWORD"}, (err, api) => {
if(err) return console.error(err);
const yourID = "000000000000000";
const msg = "Hey!";
api.sendMessage(msg, yourID);
});
Example: Sending a File
const login = require("hut-chat-api");
const fs = require("fs");
login({email: "FB_EMAIL", password: "FB_PASSWORD"}, (err, api) => {
if(err) return console.error(err);
const yourID = "000000000000000";
const msg = {
body: "Hey!",
attachment: fs.createReadStream(__dirname + '/image.jpg')
};
api.sendMessage(msg, yourID);
});
To avoid logging in every time, save AppState
(cookies, etc.) to a file.
Example: Saving AppState
const fs = require("fs");
const login = require("hut-chat-api");
const credentials = {email: "FB_EMAIL", password: "FB_PASSWORD"};
login(credentials, (err, api) => {
if(err) return console.error(err);
fs.writeFileSync('appstate.json', JSON.stringify(api.getAppState()));
});
You can also use c3c-fbstate to get fbstate.json
.
Use api.listenMqtt(callback)
to listen for chat messages.
Example: Simple Echo Bot
const fs = require("fs");
const login = require("hut-chat-api");
login({appState: JSON.parse(fs.readFileSync('appstate.json', 'utf8'))}, (err, api) => {
if(err) return console.error(err);
api.setOptions({listenEvents: true});
const stopListening = api.listenMqtt((err, event) => {
if(err) return console.error(err);
api.markAsRead(event.threadID, (err) => {
if(err) console.error(err);
});
switch(event.type) {
case "message":
if(event.body === '/stop') {
api.sendMessage("Goodbye…", event.threadID);
return stopListening();
}
api.sendMessage("TEST BOT: " + event.body, event.threadID);
break;
case "event":
console.log(event);
break;
}
});
});
Chatbot Community. For more detailed documentation, check out the Docs.
FAQs
A Facebook chat API that doesn't rely on XMPP and This new Logined and get the seqID ( CC PROJECTS AND CHATBOT COMMUNITY )
The npm package hut-chat-api receives a total of 213 weekly downloads. As such, hut-chat-api popularity was classified as not popular.
We found that hut-chat-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.