query.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:PyPlanet 作者: PyPlanet 项目源码 文件源码
def to_players(self, *players):
        """
        Set the destination of the chat message.

        :param players: Player instance(s) or player login string(s). Can be a list, or a single entry.
        :return: Self reference.
        :rtype: pyplanet.contrib.chat.query.ChatQuery
        """
        # Unpack list in unpacked list if given.
        if len(players) == 1 and isinstance(players[0], collections.Iterable):
            players = players[0]

        # Replace logins.
        if isinstance(players, Player):
            self._logins = set()
            self._logins.add(players.login)
        elif isinstance(players, str):
            self._logins = set()
            self._logins.add(players)
        elif isinstance(players, collections.Iterable) and isinstance(players, collections.Sized):
            self._logins = set()
            self.add_to(players)
        return self
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号