I am a new user in Weechat. I have made a customized weechat script from another existing script. To run that script I need to use hook command every time i send text to channel . For example /myhook  message_to_channel . I want to automate this process so every time I send messages to a channel i wouldn't need to write /myhook but just message_to_channel . Is there any way I  could make it happen. Thanks.
            Asked
            
        
        
            Active
            
        
            Viewed 201 times
        
    1
            
            
        
        Aarif Hasan
        
- 57
 - 1
 - 8
 
1 Answers
1
            
            
        The alias plugin that is included in WeeChat by default can facilitate this. 
You can run the following command to create the alias you want.
/alias add message_to_channel /myhook message_to_channel
After that, you should be able to just use /message_to_channel. You can also add arguments if you like:
$n: argument 'n' (between 1 and 9) $-m: arguments from 1 to 'm' $n-: arguments from 'n' to last $n-m: arguments from 'n' to 'm' $*: all arguments $~: last argument $var: where "var" is a local variable of buffer (see /buffer localvar) examples: $nick, $channel, $server, $plugin, $name
The documentation is here.
        Worthwelle
        
- 1,244
 - 1
 - 16
 - 19