IRC Bot engine
New in version 2017.7.0.
Example Configuration
engines: - ircbot: nick: <nick> username: <username> password: <password> host: chat.freenode.net port: 7000 channels: - salt-test - '##something' use_ssl: True use_sasl: True disable_query: True allow_hosts: - salt/engineer/.* allow_nicks: - gtmanfred
Available commands on irc are:
Example of usage
08:33:57 @gtmanfred > !ping 08:33:57 gtmanbot > gtmanfred: pong 08:34:02 @gtmanfred > !echo ping 08:34:02 gtmanbot > ping 08:34:17 @gtmanfred > !event test/tag/ircbot irc is useful 08:34:17 gtmanbot > gtmanfred: TaDa!
[DEBUG ] Sending event: tag = salt/engines/ircbot/test/tag/ircbot; data = {'_stamp': '2016-11-28T14:34:16.633623', 'data': ['irc', 'is', 'useful']}
salt.engines.ircbot.
Event
(source, code, line)
code
Alias for field number 1
line
Alias for field number 2
source
Alias for field number 0
salt.engines.ircbot.
IRCClient
(nick, host, port=6667, username=None, password=None, channels=None, use_ssl=False, use_sasl=False, char='!', allow_hosts=False, allow_nicks=False, disable_query=True)
join_channel
(channel)
on_closed
()
on_connect
()
read_messages
()
send_message
(line)
salt.engines.ircbot.
PrivEvent
(source, nick, user, host, code, channel, command, line)
channel
Alias for field number 5
code
Alias for field number 4
command
Alias for field number 6
host
Alias for field number 3
line
Alias for field number 7
nick
Alias for field number 1
source
Alias for field number 0
user
Alias for field number 2
IRC Bot for interacting with salt.
authenticate using sasl, instead of messaging NickServ. Default: False
Note
This will allow the bot user to be fully authenticated before joining any channels
Warning
Unauthenticated Access to event stream
This engine sends events calls to the event stream without authenticating them in salt. Authentication will need to be configured and enforced on the irc server or enforced in the irc channel. The engine only accepts commands from channels, so non authenticated users could be banned or quieted in the channel.
/mode +q $~a # quiet all users who are not authenticated /mode +r # do not allow unauthenticated users into the channel
It would also be possible to add a password to the irc channel, or only allow invited users to join.
© 2019 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltstack.com/en/latest/ref/engines/all/salt.engines.ircbot.html