This manual documents WeeChat chat client, it is part of WeeChat.

Latest version of this document can be found on this page: http://weechat.org/doc

1. Introduction

WeeChat (Wee Enhanced Environment for Chat) is a free chat client, fast and light, designed for many operating systems.

This manual documents way to write scripts for WeeChat, using one of supported script languages:

  • python

  • perl

  • ruby

  • lua

  • tcl

  • guile (scheme)

Note
Almost all examples in this doc are written in Python, but API is the same for other languages.

2. Scripts in WeeChat

2.1. Languages specificities

2.1.1. Python

  • You have to import weechat

  • Functions print* are called prnt* in python (because print is reserved keyword)

  • Functions are called with weechat.xxx(arg1, arg2, ...)

2.1.2. Perl

  • Functions are called with weechat::xxx(arg1, arg2, ...);

2.1.3. Ruby

  • You have to define weechat_init and call register inside

  • Functions are called with Weechat.xxx(arg1, arg2, ...)

  • Due to a limitation of Ruby (15 arguments max by function), the function Weechat.config_new_option receives the callbacks in an array of 6 strings (3 callbacks + 3 data strings), so a call to this function looks like: