本文整理汇总了Python中twisted.words.protocols.irc.IRCClient.join方法的典型用法代码示例。如果您正苦于以下问题:Python IRCClient.join方法的具体用法?Python IRCClient.join怎么用?Python IRCClient.join使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twisted.words.protocols.irc.IRCClient
的用法示例。
在下文中一共展示了IRCClient.join方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: join
# 需要导入模块: from twisted.words.protocols.irc import IRCClient [as 别名]
# 或者: from twisted.words.protocols.irc.IRCClient import join [as 别名]
def join(self, channel):
passwords = yield self.config.get("passwords")
actual, _, password = channel.partition(" ")
if password:
passwords[channel] = password
elif actual in passwords:
channel = "{} {}".format(actual, passwords[actual])
self.channels[actual] = {}
self.config.set("channels", self.channels.keys())
self.config.set("passwords", passwords)
IRCClient.join(self, channel.encode("utf8"))
nick = normalize(self.nickname)
self.dispatch("joined", actual, nick)
示例2: join
# 需要导入模块: from twisted.words.protocols.irc import IRCClient [as 别名]
# 或者: from twisted.words.protocols.irc.IRCClient import join [as 别名]
def join(self, channel, no_database=False):
actual, _, password = channel.partition(" ")
if not no_database:
c, p, ac = yield self.master.modules["db"].channelGet(actual)
if c:
actual = c
if not password and p:
password = p
yield self.master.modules["db"].channelSet(actual, password, True)
if password:
channel = u"{} {}".format(actual, password)
self.channels[actual] = {}
IRCClient.join(self, channel.encode("utf8"))
nick = normalize(self.nickname)
self.dispatch("joined", actual, nick)
示例3: join
# 需要导入模块: from twisted.words.protocols.irc import IRCClient [as 别名]
# 或者: from twisted.words.protocols.irc.IRCClient import join [as 别名]
def join(self, channel, key=None):
self.config.addChannel(channel)
return IRCClient.join(self, encode(channel), key)
示例4: join
# 需要导入模块: from twisted.words.protocols.irc import IRCClient [as 别名]
# 或者: from twisted.words.protocols.irc.IRCClient import join [as 别名]
def join(self, channel, key=None):
log.msg("Joining %r" % channel)
IRCClient.join(self, channel, key)