我如何用Python编写一个简单的IRC机器人? [英] How do i program a simple IRC bot in python?

查看:152
本文介绍了我如何用Python编写一个简单的IRC机器人?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要帮助编写一个仅连接到频道的基本IRC机器人.有人能向我解释一下吗?我设法使它连接到IRC服务器,但是我无法加入频道并登录.到目前为止,我拥有的代码是:

I need help writing a basic IRC bot that just connects to a channel.. is anyone able to explain me this? I have managed to get it to connect to the IRC server but i am unable to join a channel and log on. The code i have thus far is:

import sockethost = 'irc.freenode.org'
port = 6667
join_sock = socket.socket()
join_sock.connect((host, port))
<code here> 

任何帮助将不胜感激.

推荐答案

以Twisted的IRC协议实现为基础可能最容易.看看: http://github.com/brosner/bosnobot 以获得灵感.

It'd probably be easiest to base it on twisted's implementation of the IRC protocol. Take a look at : http://github.com/brosner/bosnobot for inspiration.

这篇关于我如何用Python编写一个简单的IRC机器人?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆