@xbibzlibrary/telebibz 3.1.1 → 3.1.2
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/lib/composer.js +0 -1
- package/lib/context.js +2 -4
- package/package.json +1 -1
package/lib/composer.js
CHANGED
|
@@ -28,7 +28,6 @@ const MSG_PROPS = {
|
|
|
28
28
|
via_bot: (m) => !!m.via_bot, reply_to_message: (m) => !!m.reply_to_message, entities: (m) => Array.isArray(m.entities),
|
|
29
29
|
media: (m) => Array.isArray(m.photo) || !!m.video || !!m.document || !!m.audio,
|
|
30
30
|
data: () => false, // khusus callback_query ditangani di bawah
|
|
31
|
-
successful_payment: (m) => !!m.successful_payment,
|
|
32
31
|
};
|
|
33
32
|
|
|
34
33
|
/** filter 'message:photo', ':text', 'callback_query': → fungsi (ctx) => boolean */
|
package/lib/context.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
const { File } = require('./file');
|
|
5
|
+
const axios = require('axios');
|
|
6
|
+
const fs = require('fs');
|
|
5
7
|
|
|
6
8
|
/** Objek "pesan" dari berbagai field update (gaya ctx.msg). */
|
|
7
9
|
function msgOf(update) {
|
|
@@ -32,7 +34,6 @@ class Context {
|
|
|
32
34
|
if (this.msg) return this.msg.chat;
|
|
33
35
|
if (this.callback_query) return this.callback_query.message && this.callback_query.message.chat;
|
|
34
36
|
if (this.inline_query || this.chosen_inline_result) return undefined;
|
|
35
|
-
if (this.business_connection) return this.business_connection.user;
|
|
36
37
|
if (this.chat_join_request) return this.chat_join_request.chat;
|
|
37
38
|
if (this.chat_member) return this.chat_member.chat;
|
|
38
39
|
if (this.my_chat_member) return this.my_chat_member.chat;
|
|
@@ -173,9 +174,6 @@ class Context {
|
|
|
173
174
|
}
|
|
174
175
|
async downloadFile(dest) {
|
|
175
176
|
const f = await this.getFile();
|
|
176
|
-
require('fs');
|
|
177
|
-
const axios = require('axios');
|
|
178
|
-
const fs = require('fs');
|
|
179
177
|
const url = `https://api.telegram.org/file/bot${this.api.token}/${f.file_path}`;
|
|
180
178
|
const res = await axios.get(url, { responseType: 'stream' });
|
|
181
179
|
const out = fs.createWriteStream(dest);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xbibzlibrary/telebibz",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.2",
|
|
4
4
|
"description": "Library Telegram Indonesia production-grade — set fitur penuh setara grammY: proxy-api segala metode, transformer, menus, inline query, media group, throttler & auto-retry, wizard + tombol + edit/delete, session swappable, webhook, polling tahan-409. //—Xbibz Official—//",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|