halbot 1990.1.15 → 1990.1.16

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/Bing Chat Telegram bob, which is simple design, easy to use, extendable and fun.",
4
- "version": "1990.1.15",
4
+ "version": "1990.1.16",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/halbot",
7
7
  "type": "module",
package/skills/chat.mjs CHANGED
@@ -13,7 +13,8 @@ const action = async (ctx, next) => {
13
13
  const [msgs, ctxs, tts, pms, extra] = [{}, {}, {}, [], {}];
14
14
  let [lastMsg, lastSent] = ['', 0];
15
15
  const packMsg = options => {
16
- const packed = [...ctx._text && !options?.tts ? [joinL2([YOU, ctx.text])] : []];
16
+ const addition = !options?.tts && (ctx._text || ctx.action) ? (ctx._text || ctx.action) : '';
17
+ const packed = [...addition ? [joinL2([YOU, addition])] : []];
17
18
  const source = options?.tts ? tts : msgs;
18
19
  const pure = [];
19
20
  ctx.selectedAi.map(n => {
@@ -22,7 +23,7 @@ const action = async (ctx, next) => {
22
23
  ) : (source[n] || '');
23
24
  pure.push(content);
24
25
  packed.push(joinL2([
25
- ...ctx.multiAi || !ctx.isDefaultAi(n) || ctx._text || ctxs[n]?.cmd ? [
26
+ ...ctx.multiAi || !ctx.isDefaultAi(n) || addition || ctxs[n]?.cmd ? [
26
27
  `${BOT}${enrich(n)}${ctxs[n]?.cmd && ` > \`${ctxs[n].cmd}\` (exit by /clear)` || ''}:`
27
28
  ] : [], content,
28
29
  ]));
@@ -28,13 +28,12 @@ const action = async (ctx, next) => {
28
28
  ...ctx.session.config = {
29
29
  ...ctx.session.config, ...ctx.config = {
30
30
  lang: ctx.cmd.args,
31
- hello: `Hello! I speak ${ctx.cmd.args}.`,
31
+ hello: `Please reply in ${ctx.cmd.args}. Hello! `,
32
32
  }
33
33
  }
34
34
  };
35
35
  Object.keys(ctx.config).map(x => cnf[x] = `${cnf[x]} <-- SET`);
36
- await ctx.map(cnf);
37
- await utilitas.timeout(1000);
36
+ ctx.action = bot.map(cnf);
38
37
  await ctx.hello();
39
38
  break;
40
39
  case 'translate': promptTranslate(ctx, ctx.cmd.args || ctx.session.config?.lang || ctx._.lang); break;