Question

I'm implementing a IRCBot to send files but can't find anything on this, has anyone ever done this?

Looking for implementation on sending files from the IRCBot to a end user. I've seen some mention of DCC but nothing for PHP

Was it helpful?

Solution

IRC is a chat protocol not a file sharing protocol, however for file sharing some client's such as mIRC use DCC (Direct Client to Client) to send any files.

This is acomplished using commands such as DCC SEND <filename> <ip> <port> <file size>

This would have to be implemented into your bot (not something IRC supports directly), therefore you would have to open a socket to their IP address and send the file in the buffer using socket_send().

http://www.php.net/manual/en/function.socket-send.php

OTHER TIPS

This PHP Bot implementation supports DCC : http://www.phpbots.org/

You either need to base your work on that one, or to read the code and cherry-pick the parts you are interested in.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top