簡體   English   中英

Twisted Python IRC bot 設置通道模式

[英]Twisted Python IRC bot set channel modes

我如何使用 Twisted Python 在我的頻道中自動為用戶語音並執行其他頻道操作員命令(甚至網絡操作命令?比如處理虛擬主機請求等)?

您可以使用IRCClient的模式function設置頻道和用戶模式: 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 function:

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM