puvox-library 1.0.15 → 1.0.17
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 +2 -2
- package/package.json +1 -1
package/library_standard.js
CHANGED
@@ -2520,14 +2520,14 @@ const puvox_library =
|
|
2520
2520
|
telegram_interval_ms: 50, // telegram seems to accept around 30 times per second, so we'd better wait around that milliseconds
|
2521
2521
|
telegram_last_sent_time: 0,
|
2522
2522
|
|
2523
|
-
async telegramMessageCached(text, chat_id, bot_key, extra_opts={}){
|
2523
|
+
async telegramMessageCached(text, chat_id, bot_key, extra_opts={}, customCacheId=null){
|
2524
2524
|
const curMS = this.milliseconds();
|
2525
2525
|
const goneMS = curMS - this.telegram_last_sent_time;
|
2526
2526
|
if ( goneMS < this.telegram_interval_ms ){
|
2527
2527
|
await this.sleep (this.telegram_interval_ms - goneMS);
|
2528
2528
|
}
|
2529
2529
|
this.telegram_last_sent_time = curMS;
|
2530
|
-
const cacheId = this.cache.file.idForContent( text +'_'+ chat_id +'_'+ bot_key +'_'+ JSON.stringify(extra_opts) );
|
2530
|
+
const cacheId = customCacheId ? customCacheId : this.cache.file.idForContent( text +'_'+ chat_id +'_'+ bot_key +'_'+ JSON.stringify(extra_opts) );
|
2531
2531
|
if (this.cache.file.addIdIfNotExists('function_telegram_message', cacheId) ){
|
2532
2532
|
return this.telegramMessage(text, chat_id, bot_key, extra_opts);
|
2533
2533
|
}
|