Since many people recently experiencing blocking from wechat web login.
The problem is when wechaty being scan, then the error message "Your login may be compromised. For account security, you cannot log in to Web WeChat. You can try mobile WeChat or Windows WeChat." pop-up. This issue is related previous found https://github.com/Chatie/wechaty/wiki/Throttled-Rate-for-WeChat-Web-API
Therefore, we should protect user that using wechaty. My idea is add all sayable, and set alias name function a delay base on how many character in a string, and each character delay 0.5s for assume is a tying time. maybe also add some more random seconds(0~5s) on top of that for more nature typing
For example, contact.say("Hello") or room.say("Hello") are 5 characters, so 5 * 0.5s = 2.5s (2500ms) + some random seconds to delay send out this message.
We should include this into all of related function.
Hi, @kis87988 , that's a very good proposal.
Here's another study of the rate limit of Tencent API: https://wxpy.readthedocs.io/zh/latest/utils.html#id7
I suggest you write a document for this, describing all case about this, and give the suggestion delay with your algorithm, and let the community discuss it, with code snip examples. (The Wiki Page you provided above should be a good place to do that)
To do this is because:
FriendRequest.add(), Room.add() etc.awaitHope we could include this into all of the related function in the future release of Wechaty with your help.
Thanks!
Class PuppetWebBridge: https://github.com/Chatie/wechaty/blob/master/src/puppet-web/bridge.ts
Here's an example: Time shifts the observable sequence based on a subscription delay and a delay selector function for each element.
var source = Rx.Observable
.range(0, 3)
.delay(function (x) { return Rx.Observable.timer(x * 400); })
.timeInterval()
.map(function (x) { return x.value + ':' + x.interval; });
var subscription = source.subscribe(
function (x) {
console.log('Next: %s', x);
},
function (err) {
console.log('Error: %s', err);
},
function () {
console.log('Completed');
});
// => Next: 0:0
// => Next: 1:400
// => Next: 2:400
// => Completed
However, if you have other good ideas or methods, please feel free to share and let's discuss about them.
@kis87988 @Gcaufy @xinbenlv I just finished a RxJS Queue module at here: https://github.com/zixia/rx-queue, which could solve this issue very clean and effective.
Please let me know if you have any thoughts about it. Thanks!
Merge to #1305
Most helpful comment
Hi, @kis87988 , that's a very good proposal.
Here's another study of the rate limit of Tencent API: https://wxpy.readthedocs.io/zh/latest/utils.html#id7
I suggest you write a document for this, describing all case about this, and give the suggestion delay with your algorithm, and let the community discuss it, with code snip examples. (The Wiki Page you provided above should be a good place to do that)
To do this is because:
FriendRequest.add(),Room.add()etc.awaitHope we could include this into all of the related function in the future release of Wechaty with your help.
Thanks!