MCPcopy
hub / github.com/bottenderjs/messaging-apis

github.com/bottenderjs/messaging-apis @v1.1.0 sqlite

repository ↗ · DeepWiki ↗ · release v1.1.0 ↗
551 symbols 1,538 edges 101 files 357 documented · 65%
README

Messaging APIs

Build Status coverage License: MIT

Messaging APIs is a mono repo which collects APIs needed for bot development.

It helps you build your bots using similar API for multiple platforms, e.g. Messenger, LINE. Learn once and make writing cross-platform bots easier.

If you are looking for a framework to build your bots, Bottender may suit for your needs. It is built on top of Messaging APIs and provides some powerful features for bot building.

Packages

Package Version Platform
messaging-api-messenger npm Messenger
messaging-api-line npm LINE
messaging-api-slack npm Slack
messaging-api-telegram npm Telegram
messaging-api-viber npm Viber
messaging-api-wechat npm WeChat

Usage

Messenger

Messenger

Install messaging-api-messenger package from the registry:

npm i --save messaging-api-messenger

or

yarn add messaging-api-messenger

Then, create a MessengerClient to call Messenger APIs:

const { MessengerClient } = require('messaging-api-messenger');

// get accessToken from facebook developers website
const client = new MessengerClient({
  accessToken: 'ACCESS_TOKEN',
});

client.sendText(userId, 'Hello World').then(() => {
  console.log('sent');
});

Check out full API documentation for more detail information.

LINE

LINE

Install messaging-api-line package from the registry:

npm i --save messaging-api-line

or

yarn add messaging-api-line

Then, create a LineClient to call LINE APIs:

const { LineClient } = require('messaging-api-line');

// get accessToken and channelSecret from LINE developers website
const client = new LineClient({
  accessToken: 'ACCESS_TOKEN',
  channelSecret: 'CHANNEL_SECRET',
});

client.pushText(userId, 'Hello World').then(() => {
  console.log('pushed');
});

Check out full API documentation for more detail information.

Slack

Slack

Install messaging-api-slack package from the registry:

npm i --save messaging-api-slack

or

yarn add messaging-api-slack

Then, create a SlackOAuthClient or SlackWebhookClient to call Slack APIs:

const { SlackOAuthClient } = require('messaging-api-slack');

// get access token by setup OAuth & Permissions function to your app.
// https://api.slack.com/docs/oauth
const client = new SlackOAuthClient({
  accessToken: 'xoxb-000000000000-xxxxxxxxxxxxxxxxxxxxxxxx',
});

client.postMessage('#random', 'Hello World').then(() => {
  console.log('sent');
});
const { SlackWebhookClient } = require('messaging-api-slack');

// get webhook URL by adding a Incoming Webhook integration to your team.
// https://my.slack.com/services/new/incoming-webhook/
const client = new SlackWebhookClient({
  url: 'https://hooks.slack.com/services/XXXXXXXX/YYYYYYYY/zzzzzZZZZZ',
});

client.sendText('Hello World').then(() => {
  console.log('sent');
});

Check out full API documentation for more detail information.

Telegram

Telegram

Install messaging-api-telegram package from the registry:

npm i --save messaging-api-telegram

or

yarn add messaging-api-telegram

Then, create a TelegramClient to call Telegram APIs:

const { TelegramClient } = require('messaging-api-telegram');

// get accessToken from telegram [@BotFather](https://telegram.me/BotFather)
const client = new TelegramClient({
  accessToken: '12345678:AaBbCcDdwhatever',
});

client.sendMessage(chatId, 'Hello World').then(() => {
  console.log('sent');
});

Check out full API documentation for more detail information.

Viber

Viber

Install messaging-api-viber package from the registry:

npm i --save messaging-api-viber

or

yarn add messaging-api-viber

Then, create a ViberClient to call Viber APIs:

const { ViberClient } = require('messaging-api-viber');

// get authToken from the "edit info" screen of your Public Account.
const client = new ViberClient({
  accessToken: 'AUTH_TOKEN',
  sender: {
    name: 'Sender',
  },
});

client.sendText(userId, 'Hello World').then(() => {
  console.log('sent');
});

Check out full API documentation for more detail information.

WeChat

WeChat

Install messaging-api-wechat package from the registry:

npm i --save messaging-api-wechat

or

yarn add messaging-api-wechat

Then, create a WechatClient to call Wechat APIs:

const { WechatClient } = require('messaging-api-wechat');

// get appId, appSecret from「微信公众平台-开发-基本配置」page
const client = new WechatClient({
  appId: 'APP_ID',
  appSecret: 'APP_SECRET',
});

client.sendText(userId, 'Hello World').then(() => {
  console.log('sent');
});

Check out full API documentation for more detail information.

Documentation

Change Log

Every release, along with the migration instructions, is documented on the CHANGELOG.md file.

License

MIT © Yoctol

Extension points exported contracts — how you extend this code

User (Interface)
(no doc)
packages/messaging-api-slack/src/SlackTypes.ts
ClientConfig (Interface)
(no doc)
packages/messaging-api-slack/src/SlackWebhookClient.ts

Core symbols most depended-on inside this repo

reply
called by 509
packages/messaging-api-line/src/LineClient.ts
request
called by 62
packages/messaging-api-telegram/src/TelegramClient.ts
sendMessage
called by 34
packages/messaging-api-messenger/src/MessengerClient.ts
callMethod
called by 22
packages/messaging-api-slack/src/SlackOAuthClient.ts
sendMessage
called by 20
packages/messaging-api-viber/src/ViberClient.ts
push
called by 18
packages/messaging-api-line/src/LineClient.ts
sendMessage
called by 16
packages/messaging-api-messenger/src/MessengerBatch.ts
multicast
called by 15
packages/messaging-api-line/src/LineClient.ts

Shape

Method 378
Function 142
Class 24
Enum 5
Interface 2

Languages

TypeScript100%

Modules by API surface

packages/messaging-api-line/src/LineClient.ts118 symbols
packages/messaging-api-messenger/src/MessengerClient.ts96 symbols
packages/messaging-api-telegram/src/TelegramClient.ts69 symbols
packages/messaging-api-messenger/src/MessengerBatch.ts37 symbols
packages/messaging-api-viber/src/ViberClient.ts31 symbols
packages/messaging-api-slack/src/SlackOAuthClient.ts31 symbols
packages/messaging-api-messenger/src/Messenger.ts23 symbols
packages/messaging-api-wechat/src/WechatClient.ts21 symbols
packages/messaging-api-line/src/LinePay.ts13 symbols
packages/messaging-api-line/src/Line.ts13 symbols
packages/messaging-api-line/src/LineNotify.ts11 symbols
packages/messaging-api-common/src/case.ts11 symbols

Dependencies from manifests, versioned

@types/append-query2.0.0 · 1×
@types/debug4.1.5 · 1×
@types/jest26.0.10 · 1×
@types/lodash4.14.156 · 1×
@types/url-join4.0.0 · 1×
@types/warning3.0.0 · 1×
@typescript-eslint/eslint-plugin4.31.1 · 1×
@typescript-eslint/parser4.31.1 · 1×
append-query2.1.0 · 1×
axios0.21.4 · 1×
axios-errorfile:../axios-error · 1×
axios-mock-adapter1.20.0 · 1×

For agents

$ claude mcp add messaging-apis \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact