In a WeeChat Perl script, all API functions and variables are
prefixed by "weechat::".
Example:
weechat::register("test", "1.0", "end_test", "WeeChat perl script");
A WeeChat Python script has to start by importing weechat:
import weechat
All API functions and variables are prefixed by
"weechat.".
Example:
weechat.register("test", "1.0", "end_test", "WeeChat python script")
In a WeeChat Ruby script, all code has to be in functions.
So for main code, you have to define a
"weechat_init" function, which is automatically
called when script is loaded by WeeChat. Example:
def weechat_init
Weechat.register("test", "1.0", "end_test", "WeeChat ruby script")
Weechat.add_command_handler("command", "my_command")
return Weechat::PLUGIN_RC_OK
end
def my_command(server, args)
Weechat.print("my command")
return Weechat::PLUGIN_RC_OK
end
All API functions are prefixed by
"Weechat." and variables by
"Weechat::".