irssi-rocketchat is an irssi module to connect to a Rocket.Chat instance
It is still in a work-in-progress state and a lot of things does not work, so use it at your own risks.
Because I like irssi and I don't like using a mouse for a text chat, nor waiting 2 seconds to autocomplete a nick
- login using an authentication token (you need to log in using a web browser to generate a token)
- list public channels
- list users
- join an existing room (public/private channel, discussion, direct message). leaving a room is not implemented
- create direct message using
/query <nick>
- receive/send messages from/to rooms
- automatic join to rooms when a message is received
- room history: the last 10 messages can be loaded using
/rocketchat history
- nicklist
- CMake
- A C compiler toolchain
- irssi development files
- glib
- Jansson (>= 2.11)
- libwebsockets (>= 4.1) with glib support
For most of these you can use your package manager:
apt-get install cmake build-essential irssi-dev libglib2.0-dev libjansson-dev
But you will need to build libwebsockets from source. Compiling libwebsockets requires libssl development files
apt-get install libssl-dev
git clone -b v4.1-stable https://libwebsockets.org/repo/libwebsockets
cd libwebsockets
mkdir build && cd build
cmake -DLWS_WITH_GLIB=1 .. && make
# as root
make install
ldconfig
Once all dependencies are installed, build and install irssi-rocketchat
cd /path/to/irssi-rocketchat
mkdir build && cd build
cmake .. && make && make install
This will install irssi-rocketchat in ~/.irssi/modules
First generate an access token:
- sign in with a web browser to your Rocket.Chat instance
- on your account page, go to "Personal access tokens"
- create a new access token and keep it visible, you will need to copy it into your irssi config file
Then define a new chatnet and a new server in your ~/.irssi/config
chatnets = {
MyRocketChat = {
type = "rocketchat";
}
);
servers = (
{
address = "chat.example.com";
chatnet = "MyRocketChat";
port = "443";
use_tls = "yes";
password "<your-access-token>";
}
);
Then open irssi and enter the following commands:
/load rocketchat
/connect MyRocketChat
Once connected you can list public channels
/rocketchat channels
foo (ID: aQhQEXsMuoS439dGS)
general (ID: GENERAL)
test (ID: 497BsckNzoaT2PeMF)
and join one or more using their ID or their name
/join aQhQEXsMuoS439dGS,GENERAL,test
To automatically join a room when connected to the server you can add it to your channels list
/channel add -auto test MyRocketChat
To start a private discussion with someone, use the /query
command
/query john
List public channels
List users
Print the last 10 lines of history for the current channel/query
Send a message to a thread.
<tmid>
is the thread id. It's displayed before each received message that are
from a thread
/query <nick> <message>
only works when the query already exists. If the query does not exist yet the message will not be sent.