开发者

Implementing CTCP commands in an IRC bot (Haskell)

开发者 https://www.devze.com 2022-12-22 06:22 出处:网络
I have followed the tutorial on the Haskell wiki about implementing an IRC bot. and everything worked out fine. But once I started extending it, I realised that It would need to respond to CTCP reques

I have followed the tutorial on the Haskell wiki about implementing an IRC bot. and everything worked out fine. But once I started extending it, I realised that It would need to respond to CTCP requests from other users for commands like version and ping. These commands work for the server but not for the bot.

I read the rfc's for CTCP and for IRC clients but they are not very useful. I did the following, but I don't think it is the required message:

write "PRIVMSG" (sender++"\001VERSION Haskellbot : v1.0 : GHCi\001"开发者_如何学Go)

This only asked for version information from the sender. So how do I go about implementing the return message for CTCP requests and other CTCP requests in general?


Upon closer inspection of the CTCP rfc, I solved it with:

write "NOTICE" (sender++"\001VERSION Haskellbot : v1.0 : GHCi\001")
0

精彩评论

暂无评论...
验证码 换一张
取 消