Is it possible to get POE :: Component :: IRC to get events for custom PRIVMSGs?

I am currently developing a c bot POE::Component::IRC

whose job, among other things, is to publish a channel list notification on a schedule, within one week.

I cannot find a way to verify that the message was successfully sent to the channel. The old Net::IRC

packet would light up accepting a message for every message sent to the channel, including those it sent itself. POE doesn't seem to do this - at least the irc_public event doesn't fire when the bot's own message is published to the channel.

Is there a flag that I can pass to an event handler to say "I really would like to receive all messages, please, even my own"? Or is there a way to do this with some sort of RAW event handler?

+3


source to share


1 answer


The IRC protocol does not duplicate your PRIVMSGs, so you just need to trust that the server received your message and handled it the way it should.

If you just want to receive POE events for messages sent, there is a plugin for that: POE :: Component :: IRC :: Plugin :: BotTraffic . It doesn't really do anything to verify that messages ever get to the server.



Fortunately, IRC runs on top of TCP , which ensures that delivery is guaranteed in order. This way, until the connection drops or hangs indefinitely, you can safely assume your commands will reach the server.

If you want to be absolutely sure, you can always follow your PRIVMSG with some command like TIME or PING that you know about, the server will reply; if this happens, you will know that he also received your PRIVMSG. Of course, even then there is still no guarantee that the server actually transmitted the message to the intended recipient (s); things like netsplits happen from time to time and can cause messages to be dropped.

+1


source







All Articles