Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.map(([channel, { path: webhookPath, ...channelConfig }]) => {
// eslint-disable-next-line import/no-dynamic-require
const ChannelBot = require(`../${channel}/${pascalcase(channel)}Bot`)
.default;
const channelBot = new ChannelBot({
...channelConfig,
sessionStore,
}) as Bot;
initializeBot(channelBot);
return {
webhookPath: webhookPath || `/webhooks/${channel}`,
bot: channelBot,
};
});