[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Send args to hook command??

From: Rocko
Subject: Send args to hook command??
Date: Wed, 6 Nov 2019 09:31:33 -0800
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

HI There.

I trying out my perl skills by writing a simple 'Hello' script .

I want to type /hello usersname  and have weechat display 'Hello username'.

But im having trouble on figuring out on how to send the username as a parameter/args. to the command.

This is my script:

weechat::register("test_perl", "acidblue", "0.1" , "GPL" , "" ,"" , "");
weechat::hook_command("hello","","","","", "say", ""); 

sub say {
    my ($buffer, $args) = @_;
    my $name;
    weechat::command($buffer, "/me says hello $name");
    return weechat::WEECHAT_RC_OK;

Please advise.

Virus-free. www.avast.com

reply via email to

[Prev in Thread] Current Thread [Next in Thread]