2020-04-07 23:13:24 +02:00
|
|
|
# IRC
|
|
|
|
|
|
2020-05-18 23:54:21 +02:00
|
|
|
|
2020-06-16 16:53:35 +02:00
|
|
|
_Disambiguation: This page is related to using IRC inside an Evennia game. To join the official
|
|
|
|
|
Evennia IRC chat, connect to irc.freenode.net and join #evennia. Alternatively, you can [join our
|
|
|
|
|
Discord](https://discord.gg/NecFePw), which is mirrored to IRC._
|
|
|
|
|
|
2021-06-23 20:05:25 +12:00
|
|
|
[IRC (Internet Relay Chat)](https://en.wikipedia.org/wiki/Internet_Relay_Chat) is a long standing
|
2020-06-16 16:53:35 +02:00
|
|
|
chat protocol used by many open-source projects for communicating in real time. By connecting one of
|
2021-10-21 21:04:14 +02:00
|
|
|
Evennia's [Channels](../Components/Communications.md) to an IRC channel you can communicate also with people not on
|
2020-06-16 16:53:35 +02:00
|
|
|
an mud themselves. You can also use IRC if you are only running your Evennia MUD locally on your
|
|
|
|
|
computer (your game doesn't need to be open to the public)! All you need is an internet connection.
|
2021-06-23 20:05:25 +12:00
|
|
|
For IRC operation you also need [twisted.words](https://twistedmatrix.com/trac/wiki/TwistedWords).
|
2020-06-16 16:53:35 +02:00
|
|
|
This is available simply as a package *python-twisted-words* in many Linux distros, or directly
|
|
|
|
|
downloadable from the link.
|
2020-04-07 23:13:24 +02:00
|
|
|
|
|
|
|
|
## Configuring IRC
|
|
|
|
|
|
|
|
|
|
To configure IRC, you'll need to activate it in your settings file.
|
|
|
|
|
|
|
|
|
|
```python
|
|
|
|
|
IRC_ENABLED = True
|
|
|
|
|
```
|
|
|
|
|
|
2020-06-16 16:53:35 +02:00
|
|
|
Start Evennia and log in as a privileged user. You should now have a new command available:
|
|
|
|
|
`@irc2chan`. This command is called like this:
|
2020-04-07 23:13:24 +02:00
|
|
|
|
|
|
|
|
@irc2chan[/switches] <evennia_channel> = <ircnetwork> <port> <#irchannel> <botname>
|
|
|
|
|
|
2020-06-16 16:53:35 +02:00
|
|
|
If you already know how IRC works, this should be pretty self-evident to use. Read the help entry
|
|
|
|
|
for more features.
|
2020-04-07 23:13:24 +02:00
|
|
|
|
|
|
|
|
## Setting up IRC, step by step
|
|
|
|
|
|
2020-06-16 16:53:35 +02:00
|
|
|
You can connect IRC to any Evennia channel (so you could connect it to the default *public* channel
|
|
|
|
|
if you like), but for testing, let's set up a new channel `irc`.
|
2020-04-07 23:13:24 +02:00
|
|
|
|
|
|
|
|
@ccreate irc = This is connected to an irc channel!
|
|
|
|
|
|
|
|
|
|
You will automatically join the new channel.
|
|
|
|
|
|
2020-06-16 16:53:35 +02:00
|
|
|
Next we will create a connection to an external IRC network and channel. There are many, many IRC
|
2021-06-23 20:05:25 +12:00
|
|
|
nets. [Here is a list](https://www.irchelp.org/networks/popular.html) of some of the biggest
|
2020-06-16 16:53:35 +02:00
|
|
|
ones, the one you choose is not really very important unless you want to connect to a particular
|
|
|
|
|
channel (also make sure that the network allows for "bots" to connect).
|
2020-04-07 23:13:24 +02:00
|
|
|
|
2020-06-16 16:53:35 +02:00
|
|
|
For testing, we choose the *Freenode* network, `irc.freenode.net`. We will connect to a test
|
|
|
|
|
channel, let's call it *#myevennia-test* (an IRC channel always begins with `#`). It's best if you
|
|
|
|
|
pick an obscure channel name that didn't exist previously - if it didn't exist it will be created
|
|
|
|
|
for you.
|
2020-04-07 23:13:24 +02:00
|
|
|
|
2020-06-16 16:53:35 +02:00
|
|
|
> *Don't* connect to `#evennia` for testing and debugging, that is Evennia's official chat channel!
|
|
|
|
|
You *are* welcome to connect your game to `#evennia` once you have everything working though - it
|
|
|
|
|
can be a good way to get help and ideas. But if you do, please do so with an in-game channel open
|
|
|
|
|
only to your game admins and developers).
|
2020-04-07 23:13:24 +02:00
|
|
|
|
|
|
|
|
The *port* needed depends on the network. For Freenode this is `6667`.
|
|
|
|
|
|
2020-06-16 16:53:35 +02:00
|
|
|
What will happen is that your Evennia server will connect to this IRC channel as a normal user. This
|
|
|
|
|
"user" (or "bot") needs a name, which you must also supply. Let's call it "mud-bot".
|
2020-04-07 23:13:24 +02:00
|
|
|
|
2020-06-16 16:53:35 +02:00
|
|
|
To test that the bot connects correctly you also want to log onto this channel with a separate,
|
|
|
|
|
third-party IRC client. There are hundreds of such clients available. If you use Firefox, the
|
|
|
|
|
*Chatzilla* plugin is good and easy. Freenode also offers its own web-based chat page. Once you
|
|
|
|
|
have connected to a network, the command to join is usually `/join #channelname` (don't forget the
|
|
|
|
|
#).
|
2020-04-07 23:13:24 +02:00
|
|
|
|
|
|
|
|
Next we connect Evennia with the IRC channel.
|
|
|
|
|
|
|
|
|
|
@irc2chan irc = irc.freenode.net 6667 #myevennia-test mud-bot
|
|
|
|
|
|
2020-06-16 16:53:35 +02:00
|
|
|
Evennia will now create a new IRC bot `mud-bot` and connect it to the IRC network and the channel
|
|
|
|
|
#myevennia. If you are connected to the IRC channel you will soon see the user *mud-bot* connect.
|
2020-04-07 23:13:24 +02:00
|
|
|
|
|
|
|
|
Write something in the Evennia channel *irc*.
|
|
|
|
|
|
|
|
|
|
irc Hello, World!
|
|
|
|
|
[irc] Anna: Hello, World!
|
|
|
|
|
|
2020-06-16 16:53:35 +02:00
|
|
|
If you are viewing your IRC channel with a separate IRC client you should see your text appearing
|
|
|
|
|
there, spoken by the bot:
|
2020-04-07 23:13:24 +02:00
|
|
|
|
|
|
|
|
mud-bot> [irc] Anna: Hello, World!
|
|
|
|
|
|
2020-06-16 16:53:35 +02:00
|
|
|
Write `Hello!` in your IRC client window and it will appear in your normal channel, marked with the
|
|
|
|
|
name of the IRC channel you used (#evennia here).
|
2020-04-07 23:13:24 +02:00
|
|
|
|
|
|
|
|
[irc] Anna@#myevennia-test: Hello!
|
|
|
|
|
|
2021-06-23 20:05:25 +12:00
|
|
|
Your Evennia gamers can now chat with users on external IRC channels!
|