| 1 |
IRC backend configuration |
| 2 |
========================= |
| 3 |
|
| 4 |
This backend lets you connect to any IRC server. |
| 5 |
To select this backend, |
| 6 |
set `BACKEND = 'IRC'`. |
| 7 |
|
| 8 |
Extra Dependencies |
| 9 |
------------------ |
| 10 |
|
| 11 |
You need to install this dependency before using Errbot with IRC:: |
| 12 |
|
| 13 |
pip install irc |
| 14 |
|
| 15 |
|
| 16 |
Account setup |
| 17 |
------------- |
| 18 |
|
| 19 |
Configure the account by setting up `BOT_IDENTITY` as follows:: |
| 20 |
|
| 21 |
BOT_IDENTITY = { |
| 22 |
'nickname' : 'err-chatbot', |
| 23 |
# 'username' : 'err-chatbot', # optional, defaults to nickname if omitted |
| 24 |
# 'password' : None, # optional |
| 25 |
'server' : 'irc.freenode.net', |
| 26 |
# 'port': 6667, # optional |
| 27 |
# 'ssl': False, # optional |
| 28 |
# 'ipv6': False, # optional |
| 29 |
# 'nickserv_password': None, # optional |
| 30 |
|
| 31 |
## Optional: Specify an IP address or hostname (vhost), and a |
| 32 |
## port, to use when making the connection. Leave port at 0 |
| 33 |
## if you have no source port preference. |
| 34 |
## example: 'bind_address': ('my-errbot.io', 0) |
| 35 |
# 'bind_address': ('localhost', 0), |
| 36 |
} |
| 37 |
|
| 38 |
You will at a minimum need to set the correct values for `nickname` and `server` above. |
| 39 |
The rest of the options can be left commented, |
| 40 |
but you may wish to set some of them. |
| 41 |
|
| 42 |
|
| 43 |
Bot admins |
| 44 |
---------- |
| 45 |
|
| 46 |
You can set `BOT_ADMINS` to configure which IRC users are bot administrators. |
| 47 |
For example: `BOT_ADMINS = ('gbin!gbin@*', '*!*@trusted.host.com')` |
| 48 |
|
| 49 |
.. note:: |
| 50 |
|
| 51 |
The default syntax for users on IRC is `{nick}!{user}@{host}` but this can |
| 52 |
be changed by adjusting the `IRC_ACL_PATTERN` setting. |
| 53 |
|
| 54 |
|
| 55 |
Channels |
| 56 |
-------- |
| 57 |
|
| 58 |
If you want the bot to join a certain channel when it starts up |
| 59 |
then set `CHATROOM_PRESENCE` with a list of channels to join. |
| 60 |
For example: `CHATROOM_PRESENCE = ('#errbotio',)` |
| 61 |
|
| 62 |
.. note:: |
| 63 |
|
| 64 |
You may leave the value for `CHATROOM_FN` at its default |
| 65 |
as it is ignored by this backend. |
| 66 |
|
| 67 |
|
| 68 |
Flood protection |
| 69 |
---------------- |
| 70 |
|
| 71 |
Many IRC servers have flood protection enabled, |
| 72 |
which means the bot will get kicked out of a channel |
| 73 |
when sending too many messages |
| 74 |
in too short a time. |
| 75 |
|
| 76 |
Errbot has a built-in message ratelimiter to avoid this situation. |
| 77 |
You can enable it by setting `IRC_CHANNEL_RATE` and `IRC_PRIVATE_RATE` |
| 78 |
to ratelimit channel and private messages, respectively. |
| 79 |
|
| 80 |
The value for these options is a (floating-point) number of seconds to wait |
| 81 |
between each message it sends. |
| 82 |
|
| 83 |
|
| 84 |
Rejoin on kick/disconnect |
| 85 |
------------------------- |
| 86 |
|
| 87 |
Errbot won't rejoin a channel by default |
| 88 |
when getting kicked out of one. |
| 89 |
If you want the bot to rejoin channels on kick, |
| 90 |
you can set `IRC_RECONNECT_ON_KICK = 5` |
| 91 |
(to join again after waiting 5 seconds). |
| 92 |
|
| 93 |
Similarly, to rejoin channels after being disconnected from the server |
| 94 |
you may set `IRC_RECONNECT_ON_DISCONNECT = 5`. |