1.0.8 • Published 2 years ago

@remote-kakao/kakaolink-plugin v1.0.8

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

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);
1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.3

2 years ago

1.0.0

2 years ago