halbot 1993.2.19 → 1993.2.21

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "halbot",
3
3
  "description": "Just another `ChatGPT` / `Gemini` / `Ollama` Telegram bob, which is simple design, easy to use, extendable and fun.",
4
- "version": "1993.2.19",
4
+ "version": "1993.2.21",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/halbot",
7
7
  "type": "module",
@@ -57,7 +57,8 @@ const action = async (ctx, next) => {
57
57
  )?.[0] || ctx.firstAi];
58
58
  }
59
59
  }
60
- ctx.multiAi = ctx.selectedAi.length > 1;
60
+ // grep 'ctx.multiAi' before uncommenting the following line
61
+ // ctx.multiAi = ctx.selectedAi.length > 1;
61
62
  await next();
62
63
  };
63
64
 
@@ -5,7 +5,8 @@ const action = async (ctx, next) => {
5
5
  switch (ctx.cmd.cmd) {
6
6
  case 'all':
7
7
  ctx.selectedAi = allAi;
8
- ctx.multiAi = ctx.selectedAi.length > 1;
8
+ // grep 'ctx.multiAi' before uncommenting the following line
9
+ // ctx.multiAi = ctx.selectedAi.length > 1;
9
10
  ctx.hello(ctx.cmd.args);
10
11
  break;
11
12
  case 'chatgpt':
@@ -9,7 +9,7 @@ const [BOT, BOTS, LN2] = [`${bot.EMOJI_BOT} `, {
9
9
 
10
10
  const enrich = (name, ctx) => {
11
11
  const m = ctx._.ai[name]?.model;
12
- return m ? ` | ${BOTS[m] ? `${BOTS[m]} ` : ''}${m}` : '';
12
+ return m ? ` ${BOTS[m] ? `| ${BOTS[m]} ${m}` : `(${m})`}` : '';
13
13
  };
14
14
 
15
15
  const action = async (ctx, next) => {
@@ -27,12 +27,11 @@ const action = async (ctx, next) => {
27
27
  ctx.selectedAi.map(n => {
28
28
  const content = source[n] || '';
29
29
  pure.push(content);
30
- packed.push(joinL2([
31
- ...(ctx.multiAi || !ctx.isDefaultAi(n) || said) && !options?.tts
32
- ? [`${BOTS[n]} ${n}${enrich(n, ctx)}:`] : [], content
33
- ]));
30
+ packed.push(joinL2([...options?.tts ? [] : [
31
+ `${BOTS[n]} ${n}${enrich(n, ctx)}:`
32
+ ], content]));
34
33
  });
35
- return options?.tts && !pure.join('').trim().length ? '' : joinL1(packed);
34
+ return pure.join('').trim().length ? joinL1(packed) : '';
36
35
  };
37
36
  const ok = async options => {
38
37
  const [curTime, curMsg] = [Date.now(), packMsg(options)];