utilitas 2001.1.151 → 2001.1.152
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/README.md +1 -1
- package/dist/utilitas.lite.mjs +1 -1
- package/dist/utilitas.lite.mjs.map +1 -1
- package/lib/bot.mjs +2 -11
- package/lib/manifest.mjs +2 -2
- package/package.json +2 -2
package/lib/bot.mjs
CHANGED
|
@@ -3,13 +3,7 @@ import { isPrimary, on, report } from './callosum.mjs';
|
|
|
3
3
|
|
|
4
4
|
const _NEED = ['telegraf'];
|
|
5
5
|
const log = (cnt, opt) => _log(cnt, import.meta.url, { time: 1, ...opt || {} });
|
|
6
|
-
const
|
|
7
|
-
|| `${err?.message || err}`.includes('Cannot set property message');
|
|
8
|
-
const end = async options => {
|
|
9
|
-
if (!bot) { return; }
|
|
10
|
-
bot.stop(options?.signal);
|
|
11
|
-
await launch;
|
|
12
|
-
};
|
|
6
|
+
const end = async options => bot && bot.stop(options?.signal);
|
|
13
7
|
const lines = (arr, sep = '\n') => arr.join(sep);
|
|
14
8
|
const sendMd = (cId, cnt, opt) => send(cId, cnt, { parse_mode, ...opt || {} });
|
|
15
9
|
|
|
@@ -24,7 +18,6 @@ const [ // https://limits.tginfo.me/en
|
|
|
24
18
|
const parse_mode = PARSE_MODE_MD;
|
|
25
19
|
|
|
26
20
|
let bot;
|
|
27
|
-
let launch;
|
|
28
21
|
|
|
29
22
|
const send = async (chatId, content, options) => {
|
|
30
23
|
try {
|
|
@@ -46,9 +39,7 @@ const init = async (options) => {
|
|
|
46
39
|
bot = new Telegraf(options?.botToken, { handlerTimeout: 1000 * 60 * 10 }); // 10 minutes
|
|
47
40
|
bot.use(useNewReplies());
|
|
48
41
|
bot.catch(console.error);
|
|
49
|
-
|
|
50
|
-
if (!isLaunchStopError(err)) { console.error(err); }
|
|
51
|
-
});
|
|
42
|
+
bot.launch();
|
|
52
43
|
bot.botInfo = await bot.telegram.getMe();
|
|
53
44
|
log(`Initialized: ${BOT}${bot.botInfo.first_name} @${bot.botInfo.username} #${bot.botInfo.id}`);
|
|
54
45
|
on(BOT_SEND, data => send(...data || []));
|
package/lib/manifest.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const manifest = {
|
|
2
2
|
"name": "utilitas",
|
|
3
3
|
"description": "Just another common utility for JavaScript.",
|
|
4
|
-
"version": "2001.1.
|
|
4
|
+
"version": "2001.1.152",
|
|
5
5
|
"private": false,
|
|
6
6
|
"homepage": "https://github.com/Leask/utilitas",
|
|
7
7
|
"main": "index.mjs",
|
|
@@ -59,7 +59,7 @@ const manifest = {
|
|
|
59
59
|
"process": "^0.11.10",
|
|
60
60
|
"puppeteer": "^24.42.0",
|
|
61
61
|
"say": "^0.16.0",
|
|
62
|
-
"telegraf": "npm:@leask/telegraf@6.0.
|
|
62
|
+
"telegraf": "npm:@leask/telegraf@6.0.1",
|
|
63
63
|
"telesignsdk": "^5.0.0",
|
|
64
64
|
"tesseract.js": "^7.0.0",
|
|
65
65
|
"twilio": "^6.0.0",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "utilitas",
|
|
3
3
|
"description": "Just another common utility for JavaScript.",
|
|
4
|
-
"version": "2001.1.
|
|
4
|
+
"version": "2001.1.152",
|
|
5
5
|
"private": false,
|
|
6
6
|
"homepage": "https://github.com/Leask/utilitas",
|
|
7
7
|
"main": "index.mjs",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"process": "^0.11.10",
|
|
71
71
|
"puppeteer": "^24.42.0",
|
|
72
72
|
"say": "^0.16.0",
|
|
73
|
-
"telegraf": "npm:@leask/telegraf@6.0.
|
|
73
|
+
"telegraf": "npm:@leask/telegraf@6.0.1",
|
|
74
74
|
"telesignsdk": "^5.0.0",
|
|
75
75
|
"tesseract.js": "^7.0.0",
|
|
76
76
|
"twilio": "^6.0.0",
|