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