1.0.13 • Published 4 years ago

nize-message v1.0.13

Weekly downloads
2
License
ISC
Repository
-
Last release
4 years ago

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
1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.10

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago