puvox-library 1.0.52 → 1.0.54
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/library_standard.js +7 -3
- package/package.json +1 -1
package/library_standard.js
CHANGED
@@ -2593,8 +2593,6 @@ const puvox_library =
|
|
2593
2593
|
|
2594
2594
|
youtubeImage(id, quality) { return 'http://img.youtube.com/vi/'+id+'/'+ (quality || "mqdefault") +'.jpg'; } ,
|
2595
2595
|
|
2596
|
-
|
2597
|
-
|
2598
2596
|
// ============================= detect mobile device ============================= //
|
2599
2597
|
IsMobileDevice(simpleORfull){
|
2600
2598
|
var simpleORfull = simpleORfull || "simple";
|
@@ -2643,8 +2641,8 @@ const puvox_library =
|
|
2643
2641
|
if (!this.startsWith(chat_id, '-100')) chat_id = '-100' + chat_id;
|
2644
2642
|
text = this.br2nl(text);
|
2645
2643
|
text = this.stripTags(text,'<b><strong><i><em><u><ins><s><strike><del><a><code><pre>'); // allowed: https://core.telegram.org/bots/api#html-style
|
2646
|
-
text = text.substring(0, 4095); //max telegram message length 4096
|
2647
2644
|
text = this.encode_html_entities(text);
|
2645
|
+
text = text.substring(0, 4095); //max telegram message length 4096
|
2648
2646
|
const requestOpts = Object.assign({'chat_id':chat_id, 'text':text}, extra_opts);
|
2649
2647
|
delete requestOpts['cache'];
|
2650
2648
|
delete requestOpts['is_repeated_call'];
|
@@ -3180,6 +3178,12 @@ const puvox_library =
|
|
3180
3178
|
},
|
3181
3179
|
},
|
3182
3180
|
|
3181
|
+
catchUnhandledExceptions (callback) {
|
3182
|
+
process.on('uncaughtException', (e) => { callback(e, "exc-uncaught"); });
|
3183
|
+
process.on('unhandledRejection', (e) => { callback(e, "uexc-nhandled"); });
|
3184
|
+
process.on('warning', e=>{ callback(e, "exc-warning"); });
|
3185
|
+
},
|
3186
|
+
|
3183
3187
|
|
3184
3188
|
|
3185
3189
|
|