utilitas 1992.3.13 → 1992.3.14
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/dist/utilitas.lite.mjs +1 -1
- package/dist/utilitas.lite.mjs.map +1 -1
- package/lib/bot.mjs +4 -1
- package/lib/manifest.mjs +1 -1
- package/package.json +1 -1
package/lib/bot.mjs
CHANGED
|
@@ -113,7 +113,7 @@ const subconscious = [{
|
|
|
113
113
|
ctx.text, { session: ctx.chatId }
|
|
114
114
|
)).responseRendered;
|
|
115
115
|
} catch (err) { resp = `[ERROR] ${err?.message || err}`; log(err); }
|
|
116
|
-
ctx.
|
|
116
|
+
ctx.replyWithMarkdown([
|
|
117
117
|
...multiEngine && !Array.isArray(bot.ai) ? [`🤖️ ${name}`] : [],
|
|
118
118
|
resp, ...multiEngine ? ['---'] : [],
|
|
119
119
|
].join('\n\n'));
|
|
@@ -143,11 +143,14 @@ const init = async (options) => {
|
|
|
143
143
|
if (isPrimary) {
|
|
144
144
|
// https://github.com/telegraf/telegraf
|
|
145
145
|
const { Telegraf } = await need('telegraf', { raw: true });
|
|
146
|
+
// https://github.com/telegraf/telegraf/issues/1736
|
|
147
|
+
const { useNewReplies } = await need('telegraf/future', { raw: true });
|
|
146
148
|
bot = new Telegraf(options?.botToken);
|
|
147
149
|
bot.private = options?.private && new Set(options.private);
|
|
148
150
|
bot.magicWord = options?.magicWord && new Set(options.magicWord);
|
|
149
151
|
bot.ai = options?.ai; // Should be an array of a map of AIs.
|
|
150
152
|
// ignore GROUP, CHANNEL by default
|
|
153
|
+
bot.use(useNewReplies());
|
|
151
154
|
bot.chatType = new Set(options?.chatType || ['mention', PRIVATE]);
|
|
152
155
|
const [mods, pmsTrain] = [[
|
|
153
156
|
...subconscious.map(s => ({ ...s, run: !options?.silent })),
|
package/lib/manifest.mjs
CHANGED