send_notice

Name

send_notice -- Sends a notice to a channel or user

Synopsis

void send_notice(string target, string message);

Description

Notices is a great way to get the users attention for warnings or ie. on join messages. The send_notice needs two parameters. One for the channel or user to send the notice to, that is target. The other one is the message to send, that is message.

Note

Some people consider it rude to notice a channel.

Example 3-1. Making an on-join message using bind_type and send_notice

class MyModule extends Wollabot_Module {

  function MyModule () {
    $this->bind_type('onjoin_message', WOLLABOT_TYPE_JOIN);
  }

  function onjoin_message ($data) {
    if ($data['channel'] == '#wollabot') {
      $this->send_notice($data['nick'], "Welcome to #wollabot. Please be nice.");
    }
  }

}

$wollabot->register_module("MyModule");