halbot 1993.2.83 → 1993.2.84

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/hal.mjs CHANGED
@@ -286,7 +286,7 @@ const memorize = async (ctx) => {
286
286
  const subconscious = [{
287
287
  run: true, priority: -8960, name: 'broca', func: async (ctx, next) => {
288
288
  const e = `Event: ${ctx.update.update_id} => ${JSON.stringify(ctx.update)}`;
289
- process.stdout.write(`[BOT] ${e}\n`);
289
+ process.stdout.write(`[HAL] ${e}\n`);
290
290
  log(e);
291
291
  ctx.done = [];
292
292
  ctx.collected = [];
@@ -437,7 +437,9 @@ const subconscious = [{
437
437
  ctx.entities = [
438
438
  ...(ctx.m.entities || []).map(e => ({ ...e, text: ctx.m.text })),
439
439
  ...(ctx.m.caption_entities || []).map(e => ({ ...e, text: ctx.m.caption })),
440
- ...(ctx.m.reply_to_message?.entities || []).map(e => ({ ...e, text: ctx.m.reply_to_message.text })),
440
+ ...(ctx.m.reply_to_message?.entities || []).filter(
441
+ x => x?.type !== bot_command
442
+ ).map(e => ({ ...e, text: ctx.m.reply_to_message.text })),
441
443
  ].map(e => ({
442
444
  ...e, matched: e.text.substring(e.offset, e.offset + e.length),
443
445
  ...e.type === 'text_link' ? { type: 'url', matched: e.url } : {},
@@ -449,7 +451,8 @@ const subconscious = [{
449
451
  case bot_command: target = e.matched.split('@')[1]; break;
450
452
  }
451
453
  return target === ctx.botInfo.username;
452
- }) || ctx.m.reply_to_message?.from?.username === ctx.botInfo.username)
454
+ }) || ctx.m.reply_to_message?.from?.username === ctx.botInfo.username
455
+ || ctx.type === 'callback_query')
453
456
  && (ctx.chatType = MENTION);
454
457
  (((ctx.txt || ctx.m.voice || ctx.m.poll || ctx.m.data || ctx.m.document
455
458
  || ctx.m.photo || ctx.m.sticker || ctx.m.video_note || ctx.m.video
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "halbot",
3
3
  "description": "Just another `ChatGPT` / `Gemini` / `Claude` / `Azure` / `Jina` / `Ollama` Telegram bob, which is simple design, easy to use, extendable and fun.",
4
- "version": "1993.2.83",
4
+ "version": "1993.2.84",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/halbot",
7
7
  "type": "module",
@@ -1,4 +1,4 @@
1
- import { alan, bot, hal, uoid, utilitas } from '../index.mjs';
1
+ import { alan, hal, uoid, utilitas } from '../index.mjs';
2
2
 
3
3
  const [EMIJI_FINISH, END, NEW, THREAD] = ['☑️', '❎', '✨', '🧵'];
4
4
 
@@ -6,9 +6,9 @@ const [CREATED, SWITCHED] = [
6
6
  `${NEW} Thread created: `, `${EMIJI_FINISH} Thread switched: `
7
7
  ];
8
8
 
9
- // moved to help and configs
9
+ // https://stackoverflow.com/questions/69924954/an-error-is-issued-when-opening-the-telebot-keyboard
10
10
  const keyboards = [[
11
- { text: `/ai ${bot.EMOJI_BOT}` },
11
+ { text: `/ai ${hal.EMOJI_BOT}` },
12
12
  { text: `/new ${NEW}` },
13
13
  { text: `/end ${END}` },
14
14
  { text: `/list ${THREAD}` },