halbot 1993.2.82 → 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 +6 -3
- package/package.json +3 -3
- package/skills/-8845_thread.mjs +3 -3
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(`[
|
|
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 || []).
|
|
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.
|
|
4
|
+
"version": "1993.2.84",
|
|
5
5
|
"private": false,
|
|
6
6
|
"homepage": "https://github.com/Leask/halbot",
|
|
7
7
|
"type": "module",
|
|
@@ -46,12 +46,12 @@
|
|
|
46
46
|
"mime": "^4.0.7",
|
|
47
47
|
"mysql2": "^3.14.0",
|
|
48
48
|
"office-text-extractor": "^3.0.3",
|
|
49
|
-
"openai": "^4.95.
|
|
49
|
+
"openai": "^4.95.1",
|
|
50
50
|
"pg": "^8.14.1",
|
|
51
51
|
"pgvector": "^0.2.0",
|
|
52
52
|
"telegraf": "^4.16.3",
|
|
53
53
|
"tesseract.js": "^6.0.1",
|
|
54
|
-
"utilitas": "^1999.1.
|
|
54
|
+
"utilitas": "^1999.1.52",
|
|
55
55
|
"youtube-transcript": "^1.2.1"
|
|
56
56
|
}
|
|
57
57
|
}
|
package/skills/-8845_thread.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { alan,
|
|
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
|
-
//
|
|
9
|
+
// https://stackoverflow.com/questions/69924954/an-error-is-issued-when-opening-the-telebot-keyboard
|
|
10
10
|
const keyboards = [[
|
|
11
|
-
{ text: `/ai ${
|
|
11
|
+
{ text: `/ai ${hal.EMOJI_BOT}` },
|
|
12
12
|
{ text: `/new ${NEW}` },
|
|
13
13
|
{ text: `/end ${END}` },
|
|
14
14
|
{ text: `/list ${THREAD}` },
|