diff options
Diffstat (limited to 'doc/pl/weechat_scripting.pl.asciidoc')
-rw-r--r-- | doc/pl/weechat_scripting.pl.asciidoc | 70 |
1 files changed, 63 insertions, 7 deletions
diff --git a/doc/pl/weechat_scripting.pl.asciidoc b/doc/pl/weechat_scripting.pl.asciidoc index 2414af300..e98461282 100644 --- a/doc/pl/weechat_scripting.pl.asciidoc +++ b/doc/pl/weechat_scripting.pl.asciidoc @@ -900,16 +900,72 @@ Zniekształcone wiadomości mogą uszkodzić WeeChat, lub spowodować wiele prob _Nowe w wersji 0.3.4._ -Można przetwarzać wiadomości IRC za pomocą info_hashtable zwanej "irc_message_parse". +Można przetwarzać wiadomości IRC za pomocą info_hashtable zwanej +"irc_message_parse". + +// TRANSLATION MISSING +The result is a hashtable with following keys +(the example values are built with this message: +`@time=2015-06-27T16:40:35.000Z :nick!user@host PRIVMSG #weechat :hello!`): + +[width="100%",cols="1,^2,10,8",options="header"] +|=== +| Key | WeeChat version | Description | Example + +| tags | ≥ 0.4.0 | + The tags in message (can be empty) | + `time=2015-06-27T16:40:35.000Z` + +| message_without_tags | ≥ 0.4.0 | + The message without the tags (the same as message if there are no tags) | + `:nick!user@host PRIVMSG #weechat :hello!` + +| nick | ≥ 0.3.4 | + The origin nick | + `nick` + +| host | ≥ 0.3.4 | + The origin host (includes the nick) | + `nick!user@host` + +| command | ≥ 0.3.4 | + The command ('PRIVMSG', 'NOTICE', ...) | + `PRIVMSG` + +| channel | ≥ 0.3.4 | + The target channel | + `#weechat` + +| arguments | ≥ 0.3.4 | + The command arguments (includes the channel) | + `#weechat :hello!` + +| text | ≥ 1.3 | + The text (for example user message) | + `hello!` + +| pos_text | ≥ 1.3 | + The index of text in message ("-1" if text was not found) | + `65` +|=== [source,python] ---- -dict = weechat.info_get_hashtable("irc_message_parse", - {"message": ":nick!user@host PRIVMSG #weechat :message here"}) -weechat.prnt("", "dict: %s" % dict) - -# wyjście: -# dict: {'nick': 'nick', 'host': 'nick!user@host', 'command': 'PRIVMSG', 'arguments': '#weechat :message here', 'channel': '#weechat'} +dict = weechat.info_get_hashtable( + "irc_message_parse", + {"message": "@time=2015-06-27T16:40:35.000Z :nick!user@host PRIVMSG #weechat :hello!"}) + +# dict == { +# "tags": "time=2015-06-27T16:40:35.000Z", +# "message_without_tags": ":nick!user@host PRIVMSG #weechat :hello!", +# "nick": "nick", +# "host": "nick!user@host", +# "command": "PRIVMSG", +# "channel": "#weechat", +# "arguments": "#weechat :hello!", +# "text": "hello!", +# "pos_text": "65", +# } ---- [[infos]] |