an experimental irc client
1comlink(3)
2
3# NAME
4
5comlink - primary lua module for use in comlink configuration
6
7# SYNOPSIS
8
9*local comlink = require*(_"comlink"_)
10
11*local conn = comlink.connect*(_config_)
12
13*local channel = comlink.selected_channel*()
14
15*comlink.log*(_msg_)
16
17*comlink.bind*(_key_, _action_)
18
19*comlink.notify*(_title_, _body_)
20
21*comlink.add_command*(_cmd_, _callback_)
22
23# DESCRIPTION
24
25The comlink module is the entrypoint into configuring and scripting comlink.
26This module provides application level API calls.
27
28*comlink.connect*
29 Accepts a configuration table. This table defines the server
30 configuration. The table has the following required fields:
31
32 - *server*: string, the server URL
33 - *user*: string, username used in SASL
34 - *nick*: string, nickname to identify as
35 - *password*: string, password to use in SASL
36 - *real_name*: string, user's real name
37
38 The following optional fields are available:
39
40 - *port*: uint16 (default=6697 (tls) or 6667), port to use for
41 connection
42 - *tls*: boolean (default=true), when true, use an encrypted connection
43
44*comlink.log*
45 Accepts a string and inserts a log statement into the comlink
46 logs. This can be helpful for debugging.
47
48*comlink.bind*
49 Accepts a string description of the _key_, as well an _action_. Keys may
50 include modifiers which must be of the form *shift*, *alt*, *ctrl*,
51 *super*, *hyper*, or *meta*. Named keys may be used as well, for example
52 *f1* or *tab*. To add a modifier to a key use a *+*, for example
53 "*ctrl+a*". An _action_ can be either a string or a lua function.
54 Available string actions are:
55
56 - *next_channel*
57 - *prev_channel*
58 - *quit*
59 - *redraw*
60
61*comlink.notify*
62 Accepts two strings: the first is the title of the notification and the
63 second is the body of the notification. This function produces a system
64 notification on terminals which support OSC 777.
65
66*comlink.add_command*
67 Adds the string _cmd_ as an available command in comlink. This command
68 will show up in the completion list as well. When invoked, the
69 _callback_ function will be called and receives the arguments from the
70 command line, with the command removed and whitespace stripped.
71
72# RETURN VALUES
73
74*comlink.connect*
75 Returns a *connection*. The connection represents a connection to a
76 single server. In the presence of the _soju.im/bouncer-networks_
77 extension, discovered networks will inherit callbacks set on
78 *connection*. See *comlink_connection*(3).
79
80*comlink.selected_channel*
81 Returns a *channel*, or *nil* if no channel is selected. See
82 *comlink_channel*(3).
83
84# SEE ALSO
85
86*comlink*(1), *comlink_connection*(3), *comlink_channel*(3)