Add Zalo channel adapter with webhook and send path
This commit is contained in:
+15
-1
@@ -1,6 +1,6 @@
|
||||
import type { Config } from '../config/index.js';
|
||||
import type { HookEngine } from '../hooks/index.js';
|
||||
import { ChannelRegistry, TelegramAdapter, WebChatAdapter, DiscordAdapter, SlackAdapter, WhatsAppAdapter, MatrixAdapter, SignalAdapter, MattermostAdapter, TeamsAdapter, GoogleChatAdapter, BlueBubblesAdapter, LineAdapter, FeishuAdapter, PairingManager } from '../channels/index.js';
|
||||
import { ChannelRegistry, TelegramAdapter, WebChatAdapter, DiscordAdapter, SlackAdapter, WhatsAppAdapter, MatrixAdapter, SignalAdapter, MattermostAdapter, TeamsAdapter, GoogleChatAdapter, BlueBubblesAdapter, LineAdapter, FeishuAdapter, ZaloAdapter, PairingManager } from '../channels/index.js';
|
||||
import { CronScheduler, WebhookHandler, GmailWatcher } from '../automation/index.js';
|
||||
import type { GatewayServer } from '../gateway/index.js';
|
||||
|
||||
@@ -182,6 +182,20 @@ export function registerChannels(deps: ChannelsDeps): ChannelsResult {
|
||||
gateway.setFeishuHandler(feishuAdapter);
|
||||
}
|
||||
|
||||
// Register Zalo adapter (if configured)
|
||||
if (config.zalo) {
|
||||
const zaloAdapter = new ZaloAdapter({
|
||||
oaAccessToken: config.zalo.oa_access_token,
|
||||
endpoint: config.zalo.endpoint,
|
||||
webhookToken: config.zalo.webhook_token,
|
||||
allowedUserIds: config.zalo.allowed_user_ids.length > 0 ? config.zalo.allowed_user_ids : undefined,
|
||||
requireMention: config.zalo.require_mention,
|
||||
mentionName: config.zalo.mention_name,
|
||||
});
|
||||
channelRegistry.register(zaloAdapter);
|
||||
gateway.setZaloHandler(zaloAdapter);
|
||||
}
|
||||
|
||||
// Register WebChat adapter (wraps the gateway)
|
||||
const webChatAdapter = new WebChatAdapter({ gateway });
|
||||
channelRegistry.register(webChatAdapter);
|
||||
|
||||
Reference in New Issue
Block a user