halbot 1995.1.3 → 1995.1.4

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 AI powered Telegram bot, which is simple design, easy to use, extendable and fun.",
4
- "version": "1995.1.3",
4
+ "version": "1995.1.4",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/halbot",
7
7
  "type": "module",
@@ -135,11 +135,11 @@ const ctxExt = ctx => {
135
135
  for (let i in pages) {
136
136
  const lastPage = ~~i === pages.length - 1;
137
137
  const shouldExtra = options?.lastMessageId || lastPage;
138
- if (options?.onProgress && !options?.lastMessageId
138
+ if (options?.processing && !options?.lastMessageId
139
139
  && pageMap[pageIds[~~i]]?.text === pages[i]) { continue; }
140
- if (options?.onProgress && !pageIds[~~i]) { // progress: new page, reply text
140
+ if (options?.processing && !pageIds[~~i]) { // progress: new page, reply text
141
141
  await ctx.resp(pages[i], false, extra);
142
- } else if (options?.onProgress) { // progress: ongoing, edit text
142
+ } else if (options?.processing) { // progress: ongoing, edit text
143
143
  await ctx.edit(
144
144
  pageIds[~~i], pages[i], false, shouldExtra ? extra : {}
145
145
  );
@@ -38,7 +38,7 @@ const action = async (ctx, next) => {
38
38
  await ctx.ok(bot.EMOJI_THINKING);
39
39
  for (let i = 0; i < 2; i++) {
40
40
  await ctx.timeout();
41
- await ctx.ok(ipsum(), { ...extra, onProgress: true });
41
+ await ctx.ok(ipsum(), { ...extra, processing: true });
42
42
  }
43
43
  await ctx.timeout();
44
44
  await ctx.ok(ipsum(), { ...extra, md });
@@ -5,17 +5,19 @@ const TOP = 'top';
5
5
 
6
6
  const listAIs = async ctx => {
7
7
  const lastMessageId = ctx?.update?.callback_query?.message?.message_id;
8
- const message = `Features:\n`
9
- + hal.uList(Object.entries(alan.FEATURE_ICONS).map(
10
- x => `${x[1]} ${x[0]}`
11
- )) + `\n\nAI${ais.length > 0 ? 's' : ''}:\n`;
8
+ const message = `*Time:* \n${new Date().toLocaleString()}\n\n`
9
+ + `*Features:*\n` + hal.uList(Object.entries(alan.FEATURE_ICONS).filter(
10
+ x => x[0] !== 'hidden'
11
+ ).map(
12
+ x => `${x[1]} \`${x[0]}\``
13
+ )) + `\n\n*AI${ais.length > 0 ? 's' : ''}:*\n`;
12
14
  const buttons = ais.map((x, i) => ({
13
15
  label: `${ctx._.session.config?.ai === x.id
14
16
  || (!ctx._.session.config?.ai && i === 0) ? `${hal.CHECK} `
15
- : ''}${x.name}: ${x.features}`,
17
+ : ''}${x.label}`,
16
18
  text: `/set --ai=${x.id}`,
17
19
  }));
18
- return await ctx.ok(message, { lastMessageId, buttons });
20
+ return await ctx.ok(message, { lastMessageId, buttons, md: true });
19
21
  };
20
22
 
21
23
  const action = async (ctx, next) => {