0

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?

4

1 回答 1

1

您可以使用 POE::Kernel 的delay例程来像一次性计时器一样一遍又一遍地调用自己。

基本上,您有一个名为my_event. 在 内my_event,您将 PRIVMSG 发送到通道。然后使用通过 POE 继承my_event的例程调用相同的事件处理程序。delay

请参阅:POE:Cookbook - 重复警报

于 2012-02-13T23:25:27.930 回答