本文整理汇总了Python中Core.chanusertracker.CUT.get_user方法的典型用法代码示例。如果您正苦于以下问题:Python CUT.get_user方法的具体用法?Python CUT.get_user怎么用?Python CUT.get_user使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Core.chanusertracker.CUT
的用法示例。
在下文中一共展示了CUT.get_user方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: pnick
# 需要导入模块: from Core.chanusertracker import CUT [as 别名]
# 或者: from Core.chanusertracker.CUT import get_user [as 别名]
def pnick(message):
# Part of a WHOIS result
if message.get_msg() == "is logged in as":
nick = message.line.split()[3]
pnick = message.line.split()[4]
# Set the user's pnick
CUT.get_user(nick, pnick=pnick)
示例2: pnick
# 需要导入模块: from Core.chanusertracker import CUT [as 别名]
# 或者: from Core.chanusertracker.CUT import get_user [as 别名]
def pnick(message):
# Part of a WHOIS result
hostmask = message.line.split()[5]
m = pnickre.match(hostmask)
if m:
nick = message.line.split()[3]
pnick = m.group(1)
# Set the user's pnick
CUT.get_user(nick, None, pnick=pnick)
示例3: join
# 需要导入模块: from Core.chanusertracker import CUT [as 别名]
# 或者: from Core.chanusertracker.CUT import get_user [as 别名]
def join(message):
# Someone is joining a channel
if message.get_nick() == Merlin.nick:
# Bot is joining the channel, so add a new object to the dict
CUT.new_chan(message.get_chan())
else:
# Someone is joining a channel we're in
CUT.join(message.get_chan(), message.get_nick())
if Config.get("Misc","usercache") == "join":
# Set the user's pnick
CUT.get_user(message.get_nick(), pnickf=message.get_pnick)
示例4: join
# 需要导入模块: from Core.chanusertracker import CUT [as 别名]
# 或者: from Core.chanusertracker.CUT import get_user [as 别名]
def join(message):
# Someone is joining a channel
if message.get_nick() == Merlin.nick:
# Bot is joining the channel, so add a new object to the dict
CUT.new_chan(message.get_chan())
else:
# Someone is joining a channel we're in
CUT.join(message.get_chan(), message.get_nick())
if CUT.mode_is("rapid", "join"):
# Set the user's pnick
CUT.get_user(message.get_nick(), message.get_chan(), pnickf=message.get_pnick)
示例5: join
# 需要导入模块: from Core.chanusertracker import CUT [as 别名]
# 或者: from Core.chanusertracker.CUT import get_user [as 别名]
def join(message):
# Someone is joining a channel
try:
chan = message.get_msg()
except MsgParseError:
chan = message.get_chan()
if message.get_nick() == Merlin.nick:
# Bot is joining the channel, so add a new object to the dict
CUT.new_chan(chan)
else:
# Someone is joining a channel we're in
CUT.join(chan, message.get_nick())
if CUT.mode_is("rapid", "join"):
# Set the user's pnick
CUT.get_user(message.get_nick(), chan, pnickf=message.get_pnick)
示例6: check_access
# 需要导入模块: from Core.chanusertracker import CUT [as 别名]
# 或者: from Core.chanusertracker.CUT import get_user [as 别名]
def check_access(self, message, user=None, channel=None):
if message.in_chan():
channel = channel or Channel.load(message.get_chan()) or Channel(maxlevel=0, userlevel=0)
if channel.maxlevel < self.access and message.reply_type() == PUBLIC_REPLY:
raise UserError
else:
channel = Channel(userlevel=0)
user = user or CUT.get_user(message.get_nick(), pnickf=message.get_pnick)
if self.is_user(user):
if max(user.access, channel.userlevel) >= self.access:
return user
else:
raise UserError
else:
if channel.userlevel >= self.access:
return True
elif message.get_pnick():
raise UserError