messaging-apis

Messaging APIs for multi-platform
授权协议 MIT License
开发语言 Python
所属分类 应用工具、 IM/聊天/语音工具
软件类型 开源软件
地区 不详
投 递 者 慕容嘉荣
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Messaging APIs

Build Status

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 Messenger
messaging-api-line LINE
messaging-api-slack Slack
messaging-api-telegram Telegram
messaging-api-viber Viber
messaging-api-wechat 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

  • 1. 如果要传输数据,最大不能超过4k并且只从 android 2.2版本开始支持。 2. GCM无论你的推送量有多大,都完全免费,没有任何限制。 3. 在 Google APIs Console page中创建一个API工程,记下工程编号(在url中#prohect:之后的数字)。 在service中打开Google Cloud Messaging for android 的选项。 在API a

  • http://dev.opera.com/articles/view/window-postmessage-messagechannel/ An Introduction to HTML5 web messaging Message events Cross-document messaging Sending a cross-document message Receiving a cross-

  • Write by Alan Yang ---------------------------------------------- 这篇文章是为了解决chrome extentions与native application进行通信,以及将extentions的内容通过exe程序保存到本地。 需要完成的任务可以拆分为三个: 1、编写一个chrome插件 2、用C/C++编写一个exe程序 3、通过j

  • consumer是通过订阅附加到topic,然后接收消息的过程。 Consumer 向 broker 发送消息流获取申请(flow permit request)以获取消息。 在 Consumer 端有一个队列,用于接收从 broker 推送来的消息。 你能够通过receiverQueueSize参数配置队列的长度 (队列的默认长度是1000) 每当 consumer.receive() 被调用一

  • 转载方便查阅。 Topic Messaging on iOS Based on the publish/subscribe model, FCM topic messaging allows you to send a message to multiple devices that have opted in to a particular topic. You compose topic me

  • System.Messaging 命名空间 提供具有以下功能的类:连接、监视和管理网络上的消息队列,以及发送、接收或查看消息。 Provides classes that allow you to connect to, monitor, and administer message queues on the network and send, receive, or peek messages

  • Topic 与其他pub-sub子系统一样,Pulsar中的主题被命名为从生产者向消费者传输信息的频道. Topic的名称为符合良好结构的URL: {persistent|non-persistent}://tenant/namespace/topic Topic名称组成 说明 持久化 / 非持久化 用来标识 topic 的类型。 Pulsar 支持两种主题类型:持久化和非持久化。 主题默认是持

  • 1.概述 HTML5 Cross Document Messaging是为了便于在不同源地址的页面间或是页面、浏览器的窗口、tab、iframe等间传递数据和信息。其核心是window.postMessage(data, origin)方法和message事件。 postMessage的第一个参数是要传递的数据,第二个参数是数据的来源(例如一个URL)。message事件处理程序通常会有一个参数e

  • 在.NET v2.0 中,废弃了许多 v1.1 的类型、方法、成员等。下面列出了废弃的类型、方法、成员在 v2.0 中的替代方法。上传上来与大家分享,希望它能够给朋友们从 v1.1 到 v2.0 的学习起到一些帮助作用。 具体的列表如下: 1、Obsoletion List By Assembly Assembly Name (click for details) Obsoleted Member

  • Chrome目前使用Firebase云消息传递(FCM)作为其推送服务。 FCM最近采用了Web Push协议。 FCM是Google云消息传递(GCM)的后续产品,支持相同的功能和更多功能。 要使用Firebase云消息传递,您需要在Firebase上设置项目(请参阅VAPID部分以绕过此步骤)。 大致流程如下: 1、在Firebase控制台中,选择创建新项目。 2、提供项目名称,然后单击创建项

  • 一、前言         打算开一个专栏,写一些k8s中遇到的问题,不定时更新。 报错信息: Error: could not get apiVersions from Kubernetes: unable to retrieve the complete list of server APIs: custom.metrics.k8s.io/v1beta1: the server is curre

  • Engineering Josh Long January 26, 2011 In this post, we will introduce the core concepts of messaging, as well as the rich support for various types of messaging that the Spring framework and its sist

 相关资料
  • Messaging模块管理设备通讯功能,可用于短信、彩信、邮件发送等。通过plus.messaging可获取设备通讯管理对象。另外也可以直接通过html中的href直接快速发送短信、拨打电话、发送邮件等。 常量: TYPE_SMS: 简单短信类型常量 TYPE_MMS: 彩信类型常量 TYPE_EMAIL: 邮件类型常量 方法: createMessage: 创建消息对象 sendMessage:

  • JBoss Messaging  是一个高性能的、支持集群的 Java 消息中间件。JBoss Messaging 1.x 是 JBoss 企业应用平台、JBoss SOA 平台、JBoss 应用服务器5的默认的JMS提供者。JBoss Messaging 2.0 启用了全新的架构,在性能上有重大的飞跃。

  • Json Messaging是使用Node.js技术构建的发布/订阅类型的消息服务器,具有如下特性: 支持TCP、UDP和WebSocket协议; 传输帧使用Json格式; 可以使用正则表达式订阅消息目的地,正则表达式中可以包含“捕获”,所有目的地匹配该正则表达式的消息,连同目的地的“捕获”都将发送到订阅方; 一个客户端可以订阅多个消息目的地; 为了简化设计,服务器端不持久化消息。

  • NativeScript Wear Messaging Plugin Adding support for Wear Messaging using the MessageClient API.This plugin is intended to be used to communicate between a handled app and an Android Wear app. Only A

  • Eclipse Messaging Toolbox 是一个 Eclipse 的插件,用于消息传递,可以添加消息到队列中以及从队列中获取消息。

  • Hermes是一个EDI工具,用于电子化信息交换 在香港大学计算机科学系的主持下于2002年1月成立, 电子商务基础平台发展中心(CECID)是一个研究和发展中心目的是为了促进电子商务基础平台的发展和提升。 我们相信以我们的研发经验,技能和知识的成功转让,将使组织能够适应快速变化的数字经济,克服今天和明天持续不断的商业挑战。 CECID的使命: 去创建一个基础平台和环境,通过技术创新,工业合作,知