Skip to content
This repository was archived by the owner on Aug 20, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions irc/.luacheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

allow_defined_top = true

read_globals = {
"minetest",
}

exclude_files = {
"irc/*",
}

globals = {
"irc",
}
16 changes: 8 additions & 8 deletions irc/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ to your mod's `depends.txt` file.
Reference
---------

irc:say([name,] message)
irc.say([name,] message)
Sends <message> to either the channel (if <name> is nil or not specified),
or to the given user (if <name> is specified).
Example:
irc:say("Hello, Channel!")
irc:say("john1234", "How are you?")
irc.say("Hello, Channel!")
irc.say("john1234", "How are you?")

irc:register_bot_command(name, cmdDef)
irc.register_bot_command(name, cmdDef)
Registers a new bot command named <name>.
When an user sends a private message to the bot with the command name, the
command's function is called.
Expand All @@ -38,7 +38,7 @@ irc:register_bot_command(name, cmdDef)
end,
};
Example:
irc:register_bot_command("hello", {
irc.register_bot_command("hello", {
params = "",
description = "Greet user",
func = function(user, param)
Expand All @@ -55,12 +55,12 @@ irc.joined_players[name]
-- Joe is talking on IRC
end

irc:register_hook(name, func)
irc.register_hook(name, func)
Registers a function to be called when an event happens. <name> is the name
of the event, and <func> is the function to be called. See HOOKS below
for more information
Example:
irc:register_hook("OnSend", function(line)
irc.register_hook("OnSend", function(line)
print("SEND: "..line)
end)

Expand All @@ -83,7 +83,7 @@ not modify these settings at runtime or you might crash the server!
Hooks
-----

The `irc:register_hook` function can register functions to be called
The `irc.register_hook` function can register functions to be called
when some events happen. The events supported are the same as the LuaIRC
ones with a few added (mostly for internal use).
See src/LuaIRC/doc/irc.luadoc for more information.
Expand Down
183 changes: 102 additions & 81 deletions irc/README.md
Original file line number Diff line number Diff line change
@@ -1,122 +1,138 @@

IRC Mod for Minetest
====================

Introduction
------------

This mod is just a glue between IRC and Minetest. It provides two-way
communication between the in-game chat, and an arbitrary IRC channel.

The forum topic is at http://minetest.net/forum/viewtopic.php?id=3905
The forum topic is [here][forum].

[forum]: https://forum.minetest.net/viewtopic.php?f=11&t=3905



Installing
----------

Quick one line install for linux:
Quick one line install for Linux:

cd <Mod directory> && git clone https://github.com/kaeza/minetest-irc.git irc && cd irc && git submodule update --init
cd <Mods directory> && git clone --recursive https://github.com/minetest-mods/irc.git

Please change `<Mod directory>` to fit your installation of minetest.
For more information, see [the wiki](http://wiki.minetest.net/Installing_mods).
Please change `<Mods directory>` to fit your installation of Minetest.
For more information, see [the wiki][wiki].

The Minetest IRC mod uses submodules, therefore you will have to run
`git submodule init` when first installing the mod, and `git submodule update`
every time that a submodule is updated. These steps can be combined as
`git submodule update --init`.
The IRC mod's git repository uses submodules, therefore you will have to run
`git submodule init` when first installing the mod (unless you used
`--recursive` as above), and `git submodule update` every time that a submodule
is updated. These steps can be combined into `git submodule update --init`.

The Minetest IRC mod also requires LuaSocket. This can be installed using your
package manager on many distributions, for example on Arch Linux:
You'll need to install LuaSocket. You can do so with your package manager on
many distributions, for example:

# # On Arch Linux:
# pacman -S lua51-socket
# # On Debian/Ubuntu:
# # Debian/Ubuntu's LuaSocket packages are broken, so use LuaRocks.
# apt-get install luarocks
# luarocks install luasocket

You will also need to add IRC to your trusted mods if you haven't disabled mod
security. Here's an example configuration line:

secure.trusted_mods = irc

[wiki]: https://wiki.minetest.net/Installing_mods


Settings
--------

All settings are changed in `minetest.conf`. If any of these settings
are not set, the default value is used.

* `irc.server` (string, default "irc.freenode.net")
This is the IRC server the mod connects to.
* `irc.server` (string):
The address of the IRC server to connect to.

* `irc.channel` (string, default "##mt-irc-mod")
The IRC channel to join.
* `irc.channel` (string):
The IRC channel to join.

* `irc.interval` (number, default 2.0)
This prevents the server from flooding. It should be at
least 2.0 but can be higher. After four messages this much
time must pass between folowing messages.
* `irc.interval` (number, default 2.0):
This prevents the server from flooding. It should be at
least 2.0 but can be higher. After four messages this much
time must pass between folowing messages.

* `irc.nick` (string, default "MT-FFFFFF")
Nickname used as "proxy" for the in-game chat.
'F' stands for a random base-16 number.
* `irc.nick` (string):
Nickname the server uses when it connects to IRC.

* `irc.password` (string, default "")
Password to use when connecting to the server.
* `irc.password` (string, default nil):
Password to use when connecting to the server.

* `irc.NSPass` (string, default nil)
NickServ password. Don't use this if you use SASL authentication.
* `irc.NSPass` (string, default nil):
NickServ password. Don't set this if you use SASL authentication.

* `irc.sasl.pass` (string, default nil)
SASL password, same as nickserv password.
You should use this instead of NickServ authentication
if the server supports it.
* `irc.sasl.pass` (string, default nil):
SASL password, same as nickserv password.
You should use this instead of NickServ authentication
if the server supports it.

* `irc.sasl.user` (string, default `irc.nick`)
The SASL username. This should normaly be set to your main NickServ account name.
* `irc.sasl.user` (string, default `irc.nick`):
The SASL username. This should normaly be set to your
NickServ account name.

* `irc.debug` (boolean, default false)
Whether to output debug information.
* `irc.debug` (boolean, default false):
Whether to output debug information.

* `irc.disable_auto_connect` (boolean, default false)
If false, the bot is connected by default. If true, a player with
the 'irc_admin' privilege has to use the /irc_connect command to
connect to the server.
* `irc.disable_auto_connect` (boolean, default false):
If false, the bot is connected by default. If true, a player with
the 'irc_admin' privilege has to use the `/irc_connect` command to
connect to the server.

* `irc.disable_auto_join` (boolean, default false)
If false, players join the channel automatically upon entering the
game. If true, each user must manually use the /join command to
join the channel. In any case, the players may use the /part
command to opt-out of being in the channel.
* `irc.disable_auto_join` (boolean, default false):
If false, players join the channel automatically upon entering the
game. If true, each user must manually use the `/join` command to
join the channel. In any case, the players may use the `/part`
command to opt-out of being in the channel.

* `irc.send_join_part` (boolean, default true):
Determines whether to send player join and part messages to the channel.

* `irc.send_join_part` (boolean, default true)
Determines whether to send player join and part messages to the channel.

Usage
-----

Once the game is connected to the IRC channel, chatting using the 'T' or
F10 hotkeys will send the messages to the channel, and will be visible
by anyone. Also, when someone sends a message to the channel, that text
will be visible in-game.
Once the game is connected to the IRC channel, chatting in-game will send
messages to the channel, and will be visible by anyone. Also, messages sent
to the channel will be visible in-game.

Messages that begin with `[off]` from in-game or IRC are not sent to the
other side.

This mod also adds a few chat commands:

* `/irc_msg <nick> <message>`
Sends a private message to a IRC user.

* `/join`
Join the IRC chat.
* `/irc_msg <nick> <message>`:
Send a private message to a IRC user.

* `/part`
Part the IRC chat.
* `/join`:
Join the IRC chat.

* `/irc_connect`
Connect the bot manually to the IRC network.
* `/part`:
Part the IRC chat.

* `/irc_disconnect`
Disconnect the bot manually from the IRC network (this does not
shutdown the game).
* `/irc_connect`:
Connect the bot manually to the IRC network.

* `/irc_reconnect`
Equivilant to `/irc_disconnect` followed by `/irc_connect`.
* `/irc_disconnect`:
Disconnect the bot manually from the IRC network (this does not
shutdown the game).

You can also send private messages from IRC to in-game players.
* `/irc_reconnect`:
Equivalent to `/irc_disconnect` followed by `/irc_connect`.

To do it, you must send a private message to the bot (set with
the `irc.nick` option above), in the following format:
You can also send private messages from IRC to in-game players
by sending a private message to the bot (set with the `irc.nick`
option above), in the following format:

@playername message

Expand All @@ -125,21 +141,29 @@ a private message from IRC with:

/msg server_nick @mtuser Hello!

To avoid possible misunderstandings (since all in-game players use the
same IRC user to converse with you), the "proxy" user will reject any
private messages that are not in that format, and will send back a
nice reminder as a private message.
The bot also supports some basic commands, which are invoked by saying
the bot name followed by either a colon or a comma and the command, or
sending a private message to it. For example: `ServerBot: help whereis`.

* `help [<command>]`:
Prints help about a command, or a list of supported commands if no
command is given.

* `uptime`:
Prints the server's running time.

The bot also supports some basic commands, which are invoked by sending
a private message to it. Use `!list` to get a list of commands, and
`!help <command>` to get help about a specific command.
* `whereis <player>`:
Prints the coordinates of the given player.

* `players`:
Lists players currently in the server.


Thanks
------

I'd like to thank the users who supported this mod both on the Minetest
Forums and on the #minetest channel. In no particular order:
Forums and on the `#minetest` channel. In no particular order:

0gb.us, ShadowNinja, Shaun/kizeren, RAPHAEL, DARGON, Calinou, Exio,
vortexlabs/mrtux, marveidemanis, marktraceur, jmf/john\_minetest,
Expand All @@ -151,10 +175,7 @@ forum topic. Thanks to you all!
License
-------

(C) 2012-2013 Diego Martínez <kaeza@users.sf.net>

See LICENSE.txt for licensing information.

The files in the irc directory are part of the LuaIRC project.
See irc/LICENSE.txt for licensing information.
See `LICENSE.txt` for details.

The files in the `irc` directory are part of the LuaIRC project.
See `irc/LICENSE.txt` for details.
Loading