# Path: wxpy/exceptions.py
# class ResponseError(Exception):
#     """
#     当 BaseResponse 的返回值不为 0 时抛出的异常
#     """
# 
#     def __init__(self, err_code, err_msg):
#         super(ResponseError, self).__init__(
#             'err_code: {}; err_msg: {}'.format(err_code, err_msg))
#         self.err_code = err_code
#         self.err_msg = err_msg


import logging
import time
from functools import wraps
from wxpy.exceptions import ResponseError
    from wxpy.api.bot import Bot
    from wxpy.api.chats import Chats, User
            friends = map(FuzzyUser, arg.friends())
        elif isinstance(arg, Chats):
            friends = map(FuzzyUser, arg)
        else:
            raise TypeError

        if mutual:
            mutual &= set(friends)
        else:
            mutual.update(friends)

    return Chats(mutual)


def detect_freq_limit(func, *args, **kwargs):
    """
    检测各类 Web 微信操作的频率限制，获得限制次数和周期
    
    :param func: 需要执行的操作函数
    :param args: 操作函数的位置参数
    :param kwargs: 操作函数的命名参数
    :return: 限制次数, 限制周期(秒数)
    """

    start = time.time()
    count = 0

    while True:
        try:
            func(*args, **kwargs)

# Path: wxpy/exceptions.py
# class ResponseError(Exception):
#     """
#     当 BaseResponse 的返回值不为 0 时抛出的异常
#     """
# 
#     def __init__(self, err_code, err_msg):
#         super(ResponseError, self).__init__(
#             'err_code: {}; err_msg: {}'.format(err_code, err_msg))
#         self.err_code = err_code
#         self.err_msg = err_msg


# Path: wxpy/utils/tools.py
import logging
import time
from functools import wraps
from wxpy.exceptions import ResponseError
    from wxpy.api.bot import Bot
    from wxpy.api.chats import Chats, User

            friends = map(FuzzyUser, arg.friends())
        elif isinstance(arg, Chats):
            friends = map(FuzzyUser, arg)
        else:
            raise TypeError

        if mutual:
            mutual &= set(friends)
        else:
            mutual.update(friends)

    return Chats(mutual)


def detect_freq_limit(func, *args, **kwargs):
    """
    检测各类 Web 微信操作的频率限制，获得限制次数和周期
    
    :param func: 需要执行的操作函数
    :param args: 操作函数的位置参数
    :param kwargs: 操作函数的命名参数
    :return: 限制次数, 限制周期(秒数)
    """

    start = time.time()
    count = 0

    while True:
        try:
            func(*args, **kwargs)

        except ResponseError as e: