简体   繁体   中英

Perl and IRC: Periodically send a message to a channel

I'm making a Perl IRC bot and I want to send a message periodically to a channel. I'm using POE::Component::IRC , but as far as I can see, there is no method or event handling this.

Is there a way to accomplish this?

You can use POE::Kernel's delay routine to act like a one-time timer calling itself over and over.

Basically, you have an event handler named my_event . Within my_event , you send the PRIVMSG to the channel. You then call this same event handler my_event using the delay routine inherited through POE.

See: POE: Cookbook - Recurring Alarms

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM