diff options
| author | jason | 2016-08-17 15:52:43 -0600 |
|---|---|---|
| committer | jason | 2016-08-17 15:52:43 -0600 |
| commit | b5322db38973661b08be27185420163291a1766a (patch) | |
| tree | 91198f948756ad98c0cb09f1cb959d9dbfc2bf33 /README.org | |
| parent | 1c123d6f199e1d0b88019d56a4bb1da082bdc79f (diff) | |
| download | warmachine-ng-b5322db38973661b08be27185420163291a1766a.tar.gz warmachine-ng-b5322db38973661b08be27185420163291a1766a.zip | |
Commit updates that i haven't commited yet
Diffstat (limited to 'README.org')
| -rw-r--r-- | README.org | 12 |
1 files changed, 9 insertions, 3 deletions
| @@ -24,7 +24,7 @@ Simply run the command: | |||
| 24 | * Writing a Connection | 24 | * Writing a Connection |
| 25 | To write a new connection protocol you must inherit from | 25 | To write a new connection protocol you must inherit from |
| 26 | ~warmachine.connections.base.Connection~. This class defines an interface you | 26 | ~warmachine.connections.base.Connection~. This class defines an interface you |
| 27 | must implement to support the plugins plugins. | 27 | must implement to support the plugins. |
| 28 | ** ~__config_prefix__~ | 28 | ** ~__config_prefix__~ |
| 29 | This global is used to decide which connection to use when it is found in the | 29 | This global is used to decide which connection to use when it is found in the |
| 30 | config file. E.g. IRC uses ~'irc'~ and Slack uses ~'slack'~. It should be | 30 | config file. E.g. IRC uses ~'irc'~ and Slack uses ~'slack'~. It should be |
| @@ -47,9 +47,12 @@ return value should be formatted in the following format: | |||
| 47 | 'message': 'The message that was received', | 47 | 'message': 'The message that was received', |
| 48 | } | 48 | } |
| 49 | #+END_SRC | 49 | #+END_SRC |
| 50 | ** ~say(message, destination)~ | ||
| 51 | This method is used by plugins to send a message to a channel or user. | ||
| 50 | ** ~id~ | 52 | ** ~id~ |
| 51 | This should return a unique id used to identify this particular connection. As | 53 | This should return a unique id used to identify this particular connection. This |
| 52 | an example, the IRC connection uses something like this: | 54 | is used by plugins when saving state. As an example, the IRC connection uses |
| 55 | something like this: | ||
| 53 | 56 | ||
| 54 | #+BEGIN_SRC python | 57 | #+BEGIN_SRC python |
| 55 | @property | 58 | @property |
| @@ -60,3 +63,6 @@ def id(self): | |||
| 60 | value = '{}-{}'.format(self.host, self.nick) | 63 | value = '{}-{}'.format(self.host, self.nick) |
| 61 | return md5(value.encode()).hexdigest() | 64 | return md5(value.encode()).hexdigest() |
| 62 | #+END_SRC | 65 | #+END_SRC |
| 66 | ** ~get_users_by_channel(channel)~ | ||
| 67 | This method should return a list of all users (including the bot) for the | ||
| 68 | connection. | ||