@remote-kakao/core
TypeScript icon, indicating that this package has built-in type declarations

2.0.0-alpha.3 • Public • Published

remote-kakao banner

remote-kakao (alpha)

Discord Server

About

remote-kakao is a Node.js module that makes it easier to create unofficial KakaoTalk bots by bridging MessengerBot and Node.js, over UDP or TCP.

Requirements

Example

import { UDPServer } from "@remote-kakao/core";

const prefix = ">";
const server = new UDPServer();

server.once("ready", (port) => {
  console.log(`Server ready on port ${port}!`);
});

server.on("chat", 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.replyText("Pong!");
    msg.replyText(`${Date.now() - timestamp}ms`);
  }
});

server.start();

Plugins

Readme

Keywords

none

Package Sidebar

Install

npm i @remote-kakao/core

Weekly Downloads

22

Version

2.0.0-alpha.3

License

MIT

Unpacked Size

27.3 kB

Total Files

35

Last publish

Collaborators

  • tica