Fixed two typos in README

This commit is contained in:
Dennis Potter 2019-01-06 18:13:04 +01:00
parent 6350aff47e
commit ef2d79d03a
1 changed files with 3 additions and 0 deletions

View File

@ -65,6 +65,7 @@ The code below shows the template for a simple plugin with a few features. The n
* It has a method `__init__()` which is executed every time the bot is started. Usually, this should load the configuration file, it should set the sensitivity on which it should execute certain callback functions, it should save the parent object, start additional threads, and execute the setup.
* It has a method `setup()` which is only executed once (ever). This can be used, for example, to create [SQLite](https://sqlite.org) tables. All data should be saved in subdirectory for that plugin in `data`. See the example below, where `<plugin1>` initiates an SQLite database.
```
.
├── plugins
@ -76,9 +77,11 @@ The code below shows the template for a simple plugin with a few features. The n
└── <pluginN>
```
* It has one method `thread_method1()` which is spawned and runs continuously in the background. **Please keep performance in mind when doing this!***. For example, is it actually necessary to continuously run the thread, or is execution only necessary every 5 minutes?
* For every sensitivity that is defined, a method must be defined that acts on it. The methods get a `room` and `event` object from the parent bot. These can be used to interact with the room. A full documentation on the [Matrix Python SDK](http://matrix-org.github.io/matrix-python-sdk/) can be found [here](http://matrix-org.github.io/matrix-python-sdk/).
* The Plugin class must contain a method `help()` which only returns the content of `plugin1/messages/help`
```python
CONFIG_LOCATION = os.path.join(os.path.dirname(__file__), 'config.json')
HELP_LOCATION = os.path.join(os.path.dirname(__file__), 'help')