0.0.2 • Published 12 months ago
@signald/bot v0.0.2
@signald/bot
Installation
`npm install @signald/bot @signald/protocol`
Usage
- Setup signald and register an account (https://signald.org/articles/getting-started/)
- Initialize the bot with the registered phone number and any message handlers you want use
import { MessageHandler, SignaldBot } from "@signald/bot";
import { getReplyRecipient, react } from "@signald/protocol";
export const handleThumbsUp: MessageHandler = async (client, message) => {
const recipient = getReplyRecipient(message);
react(client, {
username: message.account!,
...recipient,
reaction: {
emoji: "👍🏻",
remove: false,
targetAuthor: message.source,
targetSentTimestamp: message.timestamp,
},
});
};
new SignaldBot("+00000000000", [handleThumbsUp]);
0.0.2
12 months ago