%PDF- %PDF-
| Direktori : /proc/self/root/proc/3522530/root/usr/lib/python2.7/site-packages/salt/engines/ |
| Current File : //proc/self/root/proc/3522530/root/usr/lib/python2.7/site-packages/salt/engines/ircbot.pyo |
�
���^c @@ s d Z d d l m Z m Z m Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l
m Z d d l Z
d d l Z
d d l Z e j e � Z d d l Z d d l m Z e d d � Z e d d � Z d
e f d � � YZ d d d d e e d
e e e d �
Z d S( u
IRC Bot engine
.. versionadded:: 2017.7.0
Example Configuration
.. code-block:: yaml
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:
ping
return pong
echo <stuff>
return <stuff> targeted at the user who sent the commands
event <tag> [<extra>, <data>]
fire event on the master or minion event stream with the tag `salt/engines/ircbot/<tag>` and a data object with a
list of everything else sent in the message
Example of usage
.. code-block:: text
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!
.. code-block:: text
[DEBUG ] Sending event: tag = salt/engines/ircbot/test/tag/ircbot; data = {'_stamp': '2016-11-28T14:34:16.633623', 'data': ['irc', 'is', 'useful']}
i ( t absolute_importt print_functiont unicode_literalsN( t
namedtuple( t sixu Eventu source code lineu PrivEventu/ source nick user host code channel command linet IRCClientc B@ s� e Z d d d d e e d e e e d �
Z d � Z d � Z e d � � Z d � Z
d � Z d � Z d � Z
d
� Z d � Z d � Z d
� Z d � Z d � Z d � Z RS( i u !c
C@ s� | | _ | | _ | | _ | p$ | | _ | | _ | p<