Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New viber features #36

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix
DimitriosGkegkas committed Feb 28, 2022
commit 0fd74478b00ab986e20c109cd8d3ecd5e84d6ec8
18 changes: 17 additions & 1 deletion examples/viber-demo-bot/src/bot.ts
Original file line number Diff line number Diff line change
@@ -3,9 +3,25 @@ import { ViberAdapter } from '@ebenos/viber-adapter';
import { viberConfig } from './secret';

import getStartedModule from './modules/getStarted';
import {
IViberConversationStartedEvent,
IViberSubscribedEvent,
IViberUnsubscribedEvent
} from '@ebenos/viber-adapter';

export const adapter = new ViberAdapter({
authToken: viberConfig.auth_token
authToken: viberConfig.auth_token,
webhookHanlers: {
conversationStartedWebhook: async (e: IViberConversationStartedEvent) => {
console.log(e);
},
subscribeWebhook: async (e: IViberSubscribedEvent) => {
console.log(e);
},
unsubscribeWebhook: async (e: IViberUnsubscribedEvent) => {
console.log(e);
}
}
});

export const bot = new Bot<InMemoryUser>(adapter, {});
5 changes: 5 additions & 0 deletions packages/viber-adapter/lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import ViberAdapter from './adapter';

export * from './interfaces/message_types';
export * from './interfaces/tracking_data';
export * from './interfaces/api';
export * from './interfaces/webhook';
export * from './adapter';
export { ViberAdapter };