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

1.0.8 • Public • Published

remote

kakaolink-plugin

Discord Server

About

kakaolink-plugin is a remote-kakao plugin for sending KakaoLinks instead of plain text.

Requirements

  • Node.js v17+
  • @remote-kakao/core v1+

Example

import { Server } from '@remote-kakao/core';
import KakaoLinkPlugin from '@remote-kakao/kakaolink-plugin';

const config = {
  email: 'email@kakao.com',
  password: 'p@ssw0rd',
  key: '00000000000000000000000000000000',
  host: 'https://example.com',
};

const prefix = '>';
const server = new Server();

server.usePlugin(KakaoLinkPlugin, config);

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 === 'kakaolink') {
    msg.replyKakaoLink({
      id: 00000, // KakaoTalk Message Template id
      args: { arg1: args[0], arg2: args[1] }, // KakaoTalk Message Template arguments
    });
  }
});

server.start(3000);

Readme

Keywords

none

Package Sidebar

Install

npm i @remote-kakao/kakaolink-plugin

Weekly Downloads

6

Version

1.0.8

License

MIT

Unpacked Size

18 kB

Total Files

6

Last publish

Collaborators

  • tica