···8899*comlink* [options...]
10101111+# DESCRIPTION
1212+1313+Comlink is an IRC client for your terminal. It employs many modern terminal
1414+features, such as the Kitty Keyboard Protocol, mouse shapes, and OSC 8
1515+hyperlinks. It also uses many IRCv3 extensions to provide a modern chat
1616+experience.
1717+1118# OPTIONS
12191320*-v*, *--version*
···116123117124# AUTHORS
118125119119-Maintained by Tim Culverhouse <tim@timculverhouse.com>. Source code available at
120120-https://git.sr.ht/~rockorager/comlink.
126126+Written and maintained by Tim Culverhouse <tim@timculverhouse.com>, assisted by
127127+open source contributors.
128128+129129+# REPORTING BUGS
130130+131131+Bugs may be reported to the mailing list <~rockorager/comlink@lists.sr.ht> or at
132132+https://github.com/rockorager/comlink.
+84
docs/comlink.3.scd
···11+comlink(3)
22+33+# NAME
44+55+comlink - primary lua module for use in comlink configuration
66+77+# SYNOPSIS
88+99+*local comlink = require*(_"comlink"_)
1010+1111+*local conn = comlink.connect*(_config_)
1212+1313+*local channel = comlink.selected_channel*()
1414+1515+*comlink.log*(_msg_)
1616+1717+*comlink.bind*(_key_, _action_)
1818+1919+*comlink.notify*(_title_, _body_)
2020+2121+*comlink.add_command*(_cmd_, _callback_)
2222+2323+# DESCRIPTION
2424+2525+The comlink module is the entrypoint into configuring and scripting comlink.
2626+This module provides application level API calls.
2727+2828+*comlink.connect*
2929+ Accepts a configuration table. This table defines the server
3030+ configuration. The table has the following required fields:
3131+3232+ - *server*: string, the server URL
3333+ - *user*: string, username used in SASL
3434+ - *nick*: string, nickname to identify as
3535+ - *password*: string, password to use in SASL
3636+ - *real_name*: string, user's real name
3737+3838+ The following optional fields are available:
3939+4040+ - *tls*: boolean (default=true), when true, use an encrypted connection
4141+4242+*comlink.log*
4343+ Accepts a string and inserts a log statement into the comlink
4444+ logs. This can be helpful for debugging.
4545+4646+*comlink.bind*
4747+ Accepts a string description of the _key_, as well an _action_. Keys may
4848+ include modifiers which must be of the form *shift*, *alt*, *ctrl*,
4949+ *super*, *hyper*, or *meta*. Named keys may be used as well, for example
5050+ *f1* or *tab*. To add a modifier to a key use a *+*, for example
5151+ "*ctrl+a*". An _action_ can be either a string or a lua function.
5252+ Available string actions are:
5353+5454+ - *next_channel*
5555+ - *prev_channel*
5656+ - *quit*
5757+ - *redraw*
5858+5959+*comlink.notify*
6060+ Accepts two strings: the first is the title of the notification and the
6161+ second is the body of the notification. This function produces a system
6262+ notification on terminals which support OSC 777.
6363+6464+*comlink.add_command*
6565+ Adds the string _cmd_ as an available command in comlink. This command
6666+ will show up in the completion list as well. When invoked, the
6767+ _callback_ function will be called and receives the arguments from the
6868+ command line, with the command removed and whitespace stripped.
6969+7070+# RETURN VALUES
7171+7272+*comlink.connect*
7373+ Returns a *connection*. The connection represents a connection to a
7474+ single server. In the presence of the _soju.im/bouncer-networks_
7575+ extension, discovered networks will inherit callbacks set on
7676+ *connection*. See *comlink_connection*(3).
7777+7878+*comlink.selected_channel*
7979+ Returns a *channel*, or *nil* if no channel is selected. See
8080+ *comlink_channel*(3).
8181+8282+# SEE ALSO
8383+8484+*comlink*(1), *comlink_connection*(3), *comlink_channel*(3)
+32
docs/comlink_channel.3.scd
···11+comlink_channel(3)
22+33+# NAME
44+55+comlink_channel - a lua type representing an IRC channel
66+77+# SYNOPSIS
88+99+*local channel = comlink.selected_channel*()
1010+1111+*local name = channel:name*()
1212+1313+*channel:send_msg*(_msg_)
1414+1515+# DESCRIPTION
1616+1717+A *channel* represents an IRC channel.
1818+1919+*channel:send_msg*
2020+ A method on *channel* which accepts a string (_msg_). _Msg_ is sent to
2121+ the *channel* using a *PRIVMSG* IRC command. Note that this is a method
2222+ call, using lua colon syntax.
2323+2424+# RETURN VALUES
2525+2626+*channel:name*
2727+ Returns a string which is the name of the channel. Note that this is a
2828+ method call, using lua colon syntax.
2929+3030+# SEE ALSO
3131+3232+*comlink*(1), *comlink*(3)
+60
docs/comlink_connection.3.scd
···11+comlink_connection(3)
22+33+# NAME
44+55+comlink_connection - a lua type representing a connection to an IRC server
66+77+# SYNOPSIS
88+99+*local conn = comlink.connect*(_config_)
1010+1111+*conn.on_connect = function*(_conn_)
1212+1313+*conn.on_message = function*(_channel_, _sender_, _msg_)
1414+1515+*local name = conn.name*()
1616+1717+*conn.join*(_channel_)
1818+1919+2020+2121+# DESCRIPTION
2222+2323+A *connection* represents the connection to the IRC server. A *connection* is
2424+received after calling *comlink.connect*, which posts an event to connect to the
2525+server. The entire lua file is executed prior to the connection occuring. This
2626+behavior allows setting of callbacks on the connection after calling connect.
2727+All callbacks are called from the main thread, and will block the event loop
2828+until they return.
2929+3030+*conn.on_connect*
3131+ A callback which receives the *connection* object. This callback is
3232+ called when comlink receives a *RPL_WELCOME* command from the server. An
3333+ example usage is to join channels after a connection has been
3434+ established. The callback receives a *connection* object because in the
3535+ presence of _soju.im/bouncer-networks_, networks may be discovered that
3636+ the user never configured. These discovered networks will inherit the
3737+ callbacks from the bouncer connection. Users of this callback may want
3838+ to perform different actions based on the *connection*, which is best
3939+ verified using the *name* function.
4040+4141+*conn.on_message*
4242+ A callback which is called after any *PRIVMSG* or *NOTICE* is received
4343+ on the *connection*. The callback receives the channel, the sender, and
4444+ the content of the message - all as strings. The channel may be a
4545+ nickname in the case of a direct message.
4646+4747+*conn.join*
4848+ Accepts a string as the channel name to join. This performs the IRC
4949+ command *JOIN*.
5050+5151+# RETURN VALUES
5252+5353+*conn.name*
5454+ Returns a string which is the name of the connection. This is usually
5555+ the URL, but may be something else if it is a discovered network from a
5656+ bouncer.
5757+5858+# SEE ALSO
5959+6060+*comlink*(1), *comlink*(3)