aimpress-chatbot/index.js
“SamoilenkoVadym” 195299ece0 Initial commit
2025-04-27 17:05:18 +01:00

25 lines
733 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const { BotFrameworkAdapter } = require('botbuilder');
const { AImpressBot } = require('./bot');
// Твои ключи для работы с Azure Bot Service
const adapter = new BotFrameworkAdapter({
appId: 'your-app-id',
appPassword: 'your-app-password'
});
// Создание экземпляра бота
const myBot = new AImpressBot();
// Обработчик сообщений
adapter.onTurn(async (turnContext) => {
await myBot.run(turnContext);
});
// Запуск сервера для обработки запросов
const express = require('express');
const app = express();
const port = process.env.PORT || 3978;
app.listen(port, () => {
console.log(`Bot is listening on port ${port}`);
});