core
core copied to clipboard
A Node.js module to make unofficial KakaoTalk bots (within the legal scope).
remote-kakao
About
remote-kakao is a Node.js module to make unofficial (& legal) KakaoTalk bots by connecting MessengerBot with Node.js, using UDP.
Requirements
- Node.js v18+ (Recommended)
- Android smartphone w/ KakaoTalk & MessengerBot
- Devoted love toward cats
Example
import { Server } from '@remote-kakao/core';
const prefix = '>';
const server = new Server();
server.on('message', async (msg) => {
if (!msg.content.startsWith(prefix)) return;
const args = msg.content.split(' ');
const cmd = args.shift()?.slice(prefix.length);
if (cmd === 'ping') {
/*
this command's result is the ping between Node.js and MessengerBot,
not between MessengerBot and the KakaoTalk server.
*/
const timestamp = Date.now();
await msg.reply('Pong!');
msg.reply(`${Date.now() - timestamp}ms`);
}
});
server.start(3000);