fix(bot): убрать отладочные console.log и закомментировать команды summary
Удалены лишние console.log для чистоты вывода и закомментирован блок команд summary_day, summary_hours и summary_last для временного отключения их обработки.
This commit is contained in:
parent
18611835cb
commit
f22e89a461
80
bot.js
80
bot.js
@ -75,7 +75,7 @@ class TelegramHistoryBot {
|
|||||||
const trimmed = args.trim(); // удаляет лишние пробелы по краям, если нужно
|
const trimmed = args.trim(); // удаляет лишние пробелы по краям, если нужно
|
||||||
logger.info('📊 Получена команда /summy с запросом: ' + trimmed);
|
logger.info('📊 Получена команда /summy с запросом: ' + trimmed);
|
||||||
let request = await callAI('', trimmed, 'request');
|
let request = await callAI('', trimmed, 'request');
|
||||||
console.log('получили отвкт: ', typeof request, request)
|
|
||||||
if (typeof request === 'string') {
|
if (typeof request === 'string') {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ console.log('получили отвкт: ', typeof request, request)
|
|||||||
request = {persona: "Карл Маркс", messages: 22, hours: 0};
|
request = {persona: "Карл Маркс", messages: 22, hours: 0};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log('ищем персону')
|
|
||||||
let prompt = await searchInPrompts(request["persona"])
|
let prompt = await searchInPrompts(request["persona"])
|
||||||
if (!prompt) {
|
if (!prompt) {
|
||||||
logger.info('⚠️ Не найден подходящий prompt для запроса, генерируем...')
|
logger.info('⚠️ Не найден подходящий prompt для запроса, генерируем...')
|
||||||
@ -93,54 +93,54 @@ console.log('ищем персону')
|
|||||||
} else {
|
} else {
|
||||||
logger.info('✅ Найден подходящий prompt для запроса')
|
logger.info('✅ Найден подходящий prompt для запроса')
|
||||||
}
|
}
|
||||||
//handleSummaryCommand
|
|
||||||
const options = {persona:request["persona"], promptToUse:prompt}
|
const options = {persona:request["persona"], promptToUse:prompt}
|
||||||
if (request["messages"]>0) {
|
if (request["messages"]>0) {
|
||||||
await this.handleSummaryCommand(ctx, 'last', request["messages"], options);
|
await this.handleSummaryCommand(ctx, 'last', request["messages"], options);
|
||||||
} else {
|
} else {
|
||||||
await this.handleSummaryCommand(ctx, 'hours', request["hours"], options);
|
await this.handleSummaryCommand(ctx, 'hours', request["hours"], options);
|
||||||
}
|
}
|
||||||
//await ctx.reply(prompt)
|
|
||||||
|
|
||||||
});
|
});
|
||||||
// Команды суммаризации - должны быть ДО обработки обычных сообщений
|
// Команды суммаризации - должны быть ДО обработки обычных сообщений
|
||||||
this.bot.command('summary_day', async (ctx) => {
|
// this.bot.command('summary_day', async (ctx) => {
|
||||||
// if (!this.isAdmin(ctx)) {
|
// // if (!this.isAdmin(ctx)) {
|
||||||
// await ctx.deleteMessage
|
// // await ctx.deleteMessage
|
||||||
// return
|
// // return
|
||||||
|
// // }
|
||||||
|
// logger.info('📊 Получена команда summary_day');
|
||||||
|
// const args = ctx.message.text.split(' ');
|
||||||
|
// if (args.length > 1) {
|
||||||
|
// char.name=args[1]
|
||||||
// }
|
// }
|
||||||
logger.info('📊 Получена команда summary_day');
|
// await ctx.deleteMessage()
|
||||||
const args = ctx.message.text.split(' ');
|
// await this.handleSummaryCommand(ctx, 'day');
|
||||||
if (args.length > 1) {
|
// });
|
||||||
char.name=args[1]
|
//
|
||||||
}
|
// this.bot.command('summary_hours', async (ctx) => {
|
||||||
await ctx.deleteMessage()
|
// logger.info('📊 Получена команда summary_hours');
|
||||||
await this.handleSummaryCommand(ctx, 'day');
|
// const args = ctx.message.text.split(' ');
|
||||||
});
|
// if (args.length < 2 || isNaN(parseInt(args[1]))) {
|
||||||
|
// await ctx.reply('❗ Укажите количество часов: /summary_hours 6');
|
||||||
this.bot.command('summary_hours', async (ctx) => {
|
// return;
|
||||||
logger.info('📊 Получена команда summary_hours');
|
// }
|
||||||
const args = ctx.message.text.split(' ');
|
// const hours = parseInt(args[1]);
|
||||||
if (args.length < 2 || isNaN(parseInt(args[1]))) {
|
// await ctx.deleteMessage()
|
||||||
await ctx.reply('❗ Укажите количество часов: /summary_hours 6');
|
// await this.handleSummaryCommand(ctx, 'hours', hours);
|
||||||
return;
|
// });
|
||||||
}
|
//
|
||||||
const hours = parseInt(args[1]);
|
// this.bot.command('summary_last', async (ctx) => {
|
||||||
await ctx.deleteMessage()
|
// logger.info('📊 Получена команда summary_last');
|
||||||
await this.handleSummaryCommand(ctx, 'hours', hours);
|
// const args = ctx.message.text.split(' ');
|
||||||
});
|
// if (args.length < 2 || isNaN(parseInt(args[1]))) {
|
||||||
|
// await ctx.reply('❗ Укажите количество сообщений: /summary_last 50');
|
||||||
this.bot.command('summary_last', async (ctx) => {
|
// return;
|
||||||
logger.info('📊 Получена команда summary_last');
|
// }
|
||||||
const args = ctx.message.text.split(' ');
|
// const count = parseInt(args[1]);
|
||||||
if (args.length < 2 || isNaN(parseInt(args[1]))) {
|
// await ctx.deleteMessage()
|
||||||
await ctx.reply('❗ Укажите количество сообщений: /summary_last 50');
|
// await this.handleSummaryCommand(ctx, 'last', count);
|
||||||
return;
|
// });
|
||||||
}
|
|
||||||
const count = parseInt(args[1]);
|
|
||||||
await ctx.deleteMessage()
|
|
||||||
await this.handleSummaryCommand(ctx, 'last', count);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Команды помощи
|
// Команды помощи
|
||||||
//this.bot.command('summary_help', async (ctx) => await this.sendHelp(ctx));
|
//this.bot.command('summary_help', async (ctx) => await this.sendHelp(ctx));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user