本文整理汇总了Python中Core.chanusertracker.CUT.auth_user方法的典型用法代码示例。如果您正苦于以下问题:Python CUT.auth_user方法的具体用法?Python CUT.auth_user怎么用?Python CUT.auth_user使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Core.chanusertracker.CUT
的用法示例。
在下文中一共展示了CUT.auth_user方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: letmein
# 需要导入模块: from Core.chanusertracker import CUT [as 别名]
# 或者: from Core.chanusertracker.CUT import auth_user [as 别名]
def letmein(message):
"""Invites the user to the private channel, if they provide their username and password"""
# P redundancy
msg = message.get_msg().split()
if len(msg) != 3:
message.alert("!letmein user pass")
return
try:
user = CUT.auth_user(message.get_nick(), message.get_pnick, username=msg[1], password=msg[2])
if (user is not None) and user.is_member():
message.invite(message.get_nick(), Config.get("Channels","home"))
except UserError:
message.alert("You don't have access to this command")
示例2: auth
# 需要导入模块: from Core.chanusertracker import CUT [as 别名]
# 或者: from Core.chanusertracker.CUT import auth_user [as 别名]
def auth(message):
"""Authenticates the user, if they provide their username and password"""
# P redundancy
msg = message.get_msg().split()
if len(msg) != 3:
message.alert("!auth user pass")
return
try:
user = CUT.auth_user(message.get_nick(), message.get_pnick, username=msg[1], password=msg[2])
if user is not None:
message.reply("You have been authenticated as %s" % (user.name,))
except UserError:
message.alert("You don't have access to this command")