Weechat在每个发送消息中添加钩子命令

问题描述 投票:0回答:1

我是Weechat的新用户。我已经从另一个现有脚本中制作了一个定制的weechat脚本。要运行该脚本,每次将文本发送到channel时,都需要使用hook命令。例如/myhook message_to_channel。我想自动执行此过程,因此每次将消息发送到某个通道时,我都不需要写/myhook,而只需写message_to_channel。有什么办法可以实现呢?谢谢。

irc weechat
1个回答
1
投票

默认情况下,WeeChat中包含的alias插件可以简化此操作。

您可以运行以下命令来创建所需的别名。

/alias add message_to_channel /myhook message_to_channel

此后,您应该只可以使用/message_to_channel。您还可以根据需要添加参数:

    $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

文档为here

© www.soinside.com 2019 - 2024. All rights reserved.