【问题标题】:Twisted Python IRC bot set channel modesTwisted Python IRC bot 设置频道模式
【发布时间】:2011-10-05 00:28:44
【问题描述】:

如何使用 Twisted Python 在我的频道中自动为用户语音并执行其他频道操作员命令(甚至网络操作员命令?比如处理虚拟主机请求等)?

【问题讨论】:

  • 我想你可以更具体一些,你在找图书馆吗? twistedmatrix.com 列出了可能适合您的任务的列表。

标签: python twisted irc bots


【解决方案1】:

您可以使用 IRCClient 的模式功能来设置频道和用户模式: http://twistedmatrix.com/documents/11.0.0/api/twisted.words.protocols.irc.IRCClient.html#mode

如果您按照http://www.eflorenzano.com/blog/post/writing-markov-chain-irc-bot-twisted-and-python/ 的指南进行操作,则可以创建一个 privmsg 函数:

def privmsg(self, user, channel, msg):
    if msg == "!voiceme":
        self.mode(self.factory.channel, True, 'v', user=user)

【讨论】:

    猜你喜欢
    • 2015-11-24
    • 1970-01-01
    • 2012-06-05
    • 2012-06-06
    • 2023-03-27
    • 2015-03-23
    • 1970-01-01
    • 1970-01-01
    • 2017-02-25
    相关资源
    最近更新 更多