diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2017-06-03 15:42:05 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2017-06-03 15:42:05 +0200 |
commit | a195fa2af5b8ee29d891ce1053379275ad8eb15e (patch) | |
tree | 50596e97753ef14aad24e89634211cc5dcb28a6c /doc/ja/weechat_scripting.ja.adoc | |
parent | da8f19bcee8e59d9b9e4d392d7d0067988503b7f (diff) | |
download | weechat-a195fa2af5b8ee29d891ce1053379275ad8eb15e.zip |
doc: use WeeChat IRC message parsing function in IRC hook example (scripting guide)
Diffstat (limited to 'doc/ja/weechat_scripting.ja.adoc')
-rw-r--r-- | doc/ja/weechat_scripting.ja.adoc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/doc/ja/weechat_scripting.ja.adoc b/doc/ja/weechat_scripting.ja.adoc index 8b7ac4c6a..998e6ec62 100644 --- a/doc/ja/weechat_scripting.ja.adoc +++ b/doc/ja/weechat_scripting.ja.adoc @@ -1047,12 +1047,11 @@ xxx,irc_in2_yyy:: def join_cb(data, signal, signal_data): # シグナル、例えば: "freenode,irc_in2_join" # signal_data は IRC メッセージ、例えば: ":nick!user@host JOIN :#channel" - nick = weechat.info_get("irc_nick_from_host", signal_data) server = signal.split(",")[0] - channel = signal_data.split(":")[-1] - buffer = weechat.info_get("irc_buffer", "%s,%s" % (server, channel)) + msg = weechat.info_get_hashtable("irc_message_parse", {"message": signal_data}) + buffer = weechat.info_get("irc_buffer", "%s,%s" % (server, msg["channel"])) if buffer: - weechat.prnt(buffer, "Eheh, %s has joined this channel!" % nick) + weechat.prnt(buffer, "%s (%s) has joined this channel!" % (msg["nick"], msg["host"])) return weechat.WEECHAT_RC_OK # 全ての IRC サーバに対する JOIN メッセージをキャッチするにはサーバの指定に |