当前位置: 首页>>代码示例>>Python>>正文


Python IRCClient.notice方法代码示例

本文整理汇总了Python中twisted.words.protocols.irc.IRCClient.notice方法的典型用法代码示例。如果您正苦于以下问题:Python IRCClient.notice方法的具体用法?Python IRCClient.notice怎么用?Python IRCClient.notice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在twisted.words.protocols.irc.IRCClient的用法示例。


在下文中一共展示了IRCClient.notice方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: notice

# 需要导入模块: from twisted.words.protocols.irc import IRCClient [as 别名]
# 或者: from twisted.words.protocols.irc.IRCClient import notice [as 别名]
    def notice(self, user, message):
        """
        Send a notice to a user.

        Notices are like normal message, but should never get automated
        replies.

        @type   user:   Destination, Hostmask or str
        @param  user:   The user or channel to send a notice to.
        
        @type   message: str
        @param  message: The contents of the notice to send.
        """
        if isinstance(user, Destination):
            self._log.debug('Implicitly converting Destination to raw format for notice delivery: %s --> %s',
                            repr(user), user.raw)
            user = user.raw

        if isinstance(user, Hostmask):
            self._log.debug('Implicitly converting Hostmask to nick format for notice delivery: %s --> %s',
                            repr(user), user.nick)
            user = user.nick

        IRCClient.notice(self, user, message)
开发者ID:FujiMakoto,项目名称:firefly-irc,代码行数:26,代码来源:__init__.py

示例2: notice

# 需要导入模块: from twisted.words.protocols.irc import IRCClient [as 别名]
# 或者: from twisted.words.protocols.irc.IRCClient import notice [as 别名]
 def notice(self, user, message):
     IRCClient.notice(self, user.encode("utf8"), message.encode("utf8"))
     nick = normalize(self.nickname)
     self.dispatch("sent_notice", user, nick, message)
开发者ID:lae,项目名称:Servrhe,代码行数:6,代码来源:irc.py


注:本文中的twisted.words.protocols.irc.IRCClient.notice方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。