1.0.13 • Published 4 years ago
nize-message v1.0.13
Installation
You can create a new Bottender app using the CLI tools:
npm install nize-message
Documentation
You can find the Nize documentation on the website.
Examples
We have a bunch of examples in the examples folder. Here is the first one to get you started:
// index.js
export function buildText(text: string): TextMessage {
return {
type: MessageType.Text,
data: {
text: text
}
};
}
export function buildLocation(latitude: number, longitude: number, address?: string, title?: string): LocationMessage {
return {
type: MessageType.Location,
data: {
latitude: latitude,
longitude: longitude,
address: address || '',
title: title || ''
}
};
}
export function buildSticker(stickerId: string, packageId?: string, originalContentUrl?: string): StickerMessage {
return {
type: MessageType.Sticker,
data: {
stickerId: stickerId,
packageId: packageId || '0',
originalContentUrl: originalContentUrl || ''
}
};
}
export function buildImage(id?: string, originalContentUrl?: string): ImageMessage {
return {
type: MessageType.Image,
data: {
id: id || '0',
contentUrl: originalContentUrl || '',
previewImageUrl: originalContentUrl || '',
}
};
}
export function buildFollow(): FollowMessage {
return {
type: MessageType.Follow,
data: {}
};
}
export function buildUnfollow(): UnfollowMessage {
return {
type: MessageType.Unfollow,
data: {}
};
}
export function buildQuickReply(text: string, items: QuickReplyItem[]): QuickReplyMessage {
return {
type: MessageType.QuickReply,
data: { text, items }
};
}
export function buildCarousel(items: CarouselItem[]): CarouselMessage {
return {
type: MessageType.Carousel,
data: { items }
};
}
Notable Features
Messenger
- Text
- Image
- Handover Protocol
- Persona
- Built-in NLP
- Multiple Pages
LINE
- Text
- Imagep
- Location
- Sticker
- Follow
- Unfollow
- QuickReply
- Carousel