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


Python CUT.nick_in_chan方法代码示例

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


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

示例1: router

# 需要导入模块: from Core.chanusertracker import CUT [as 别名]
# 或者: from Core.chanusertracker.CUT import nick_in_chan [as 别名]
 def router(self, message, command):
     for name, regex, access in self.routes:
         params = regex.match(command)
         if params is None:
             continue
         else:
             break
     else:
         raise ParseError
     
     route = getattr(self, name)
     
     user = self.check_access(message, access)
     if user is None:
         raise UserError
     
     if getattr(route, "_USER", False) is True:
         if self.is_user(user) is False:
             message.get_pnick()
             raise UserError
     
     if getattr(route, "_PLANET", False) is True:
         if self.user_has_planet(user) is False:
             raise PrefError
     
     if getattr(route, "_CHANNEL", None) is not None:
         if self.is_chan(message, route._CHANNEL) is False:
             raise ChanParseError(route._CHANNEL)
     
     if getattr(route, "_USER_IN", None) is not None:
         if CUT.nick_in_chan(message.get_nick(), route._USER_IN) is not True:
             raise ChanParseError(route._USER_IN)
     
     return route, name, user, params
开发者ID:JDD,项目名称:merlin,代码行数:36,代码来源:loadable.py

示例2: notice

# 需要导入模块: from Core.chanusertracker import CUT [as 别名]
# 或者: from Core.chanusertracker.CUT import nick_in_chan [as 别名]
 def notice(self, text, target=None, priority=0):
     # If we're opped in a channel in common with the user, we can reply with
     #  CNOTICE instead of NOTICE which doesn't count towards the flood limit.
     if hasattr(self, "_channel") and CUT.opped(self.get_chan()) and CUT.nick_in_chan(target or self.get_nick(), self.get_chan()):
         self.write("CNOTICE %s %s :%s" % (target or self.get_nick(), self.get_chan(), text), priority=priority)
     else:
         self.write("NOTICE %s :%s" % (target or self.get_nick(), text), priority=priority)
开发者ID:JDD,项目名称:merlin,代码行数:9,代码来源:actions.py

示例3: privmsg

# 需要导入模块: from Core.chanusertracker import CUT [as 别名]
# 或者: from Core.chanusertracker.CUT import nick_in_chan [as 别名]
 def privmsg(self, text, target=None, priority=0):
     if os.path.isfile("/tmp/meetingmode"):
         return
         # Privmsg someone. Target defaults to the person who triggered this line
         # Should we send colours?
     if (
         Config.has_option("Connection", "color")
         and not Config.has_option("NoColor", target)
         and not (target[0] in ["#", "&"] and Config.has_option("NoColorChan", target[1:]))
     ):
         text = "\x03" + Config.get("Connection", "color") + text + "\x0F"
         color = True
     else:
         color = False
     # If we're opped in a channel in common with the user, we can reply with
     #  CPRIVMSG instead of PRIVMSG which doesn't count towards the flood limit.
     if (
         (not target or target[0] not in "#&")
         and hasattr(self, "_channel")
         and CUT.opped(self.get_chan())
         and CUT.nick_in_chan(target or self.get_nick(), self.get_chan())
     ):
         self.write("CPRIVMSG %s %s :%s" % (target or self.get_nick(), self.get_chan(), text), color, priority)
     else:
         self.write("PRIVMSG %s :%s" % (target or self.get_nick(), text), color, priority)
开发者ID:liam-wiltshire,项目名称:merlin,代码行数:27,代码来源:actions.py

示例4: execute

# 需要导入模块: from Core.chanusertracker import CUT [as 别名]
# 或者: from Core.chanusertracker.CUT import nick_in_chan [as 别名]
 def execute(self, message, user, params):
     if params.group(1):
         if not user.is_admin():
             message.alert("Insufficient access to send the help to %s." % params.group(1))
             return
         from Hooks.scans.request import request
         tnick = params.group(1).strip()
         if not CUT.nick_in_chan(tnick,request().scanchan()):
             message.alert("%s does not appear to be in the scanner channel. Aborting." % tnick)
             return
         if message.reply_type() == NOTICE_REPLY:
             message.notice(self.helptext, tnick, 2)
         else:
             message.privmsg(self.helptext, tnick, 2)
     elif message.reply_type() == PUBLIC_REPLY and not user.is_admin():
         message.alert("Insufficient access to spam the channel. Try another prefix." % params.group(1))
     else:
         message.reply(self.helptext, 2)
开发者ID:JDD,项目名称:merlin,代码行数:20,代码来源:scannerhelp.py


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