We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Add Google Style Docstrings
We should implement Google Style Docstrings to every function, method, class in opsdroid. This style will support existing documentation and will help in the future by generating documentation automatically.

This consists in a bit of effort so this issue can be worked by more than one contributor, just make sure that everyone knows what you are working on in order to avoid other contributors spending time on something that you are working on.

If you are unfamiliar with the Google Style Docstrings I'd recommend that you check these resources:

 - [Sphix 1.8.0+ - Google Style Docstrings](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html)



Docstrings that need to be updated:

- main.py
  - [x] configure_lang
  - [ ] configure_log
  - [ ] get_logging_level
  - [ ] check_dependencies
  - [ ] print_version
  - [ ] print_example_config
  - [ ] edit_files
  - [x] welcome_message
- ~~helper.py~~
  - [x] get_opsdroid
  - [x] del_rw
  - [x] move_config_to_appdir
- memory.py
  - [x] Memory
  - [x] get
  - [x] put
  - [x] _get_from_database
  - [x] _put_to_database
- message.py
  - [x] Message
  - [x]  __init__
  - [x]  _thinking_delay
  - [x]  _typing delay
  - [x]  respond
  - [x]  react
- web.py
  - [ ] Web
  - [x] get_port
  - [x] get_host
  - [x]  get_ssl_context
  - [ ]  start
  - [ ]  build_response
  - [ ]  web_index_handler
  - [ ]  web_stats_handler
- matchers.py
  - [ ] match_regex
  - [ ] match_apiai_action
  - [ ] match_apiai_intent
  - [ ]  match_dialogflow_action
  - [ ]  match_dialogflow_intent
  - [ ] match_luisai_intent
  - [ ] match_rasanlu
  - [ ] match_recastai
  - [ ] match_witai
  - [ ] match_crontab
  - [ ] match_webhook
  - [ ] match_always
- core.py
  - [ ] OpsDroid
  - [ ] default_connector
  - [ ] exit
  - [ ] critical
  - [ ]  call_stop
  - [ ] disconnect
  - [ ] stop
  - [ ] load
  - [ ] start_loop
  - [x] setup_skills
  - [ ] train_parsers
  - [ ] start_connector_tasks
  - [ ] start_database
  - [ ] run_skill
  - [ ] get_ranked_skills
  - [ ] parse
- loader.py
  - [ ] Loader
  - [x] import_module_from_spec
  - [x] import_module
  - [x] check_cache
  - [x] build_module_import_path
  - [x] build_module_install_path
  - [x] git_clone
  - [x] git_pull
  - [x] pip_install_deps
  - [x] create_default_config
  - [x] load_config_file
  - [ ] envvar_constructor
  - [ ] include_constructor
  - [x] setup_modules_directory
  - [x] load_modules_from_config
  - [x] _load_modules
  - [x] _install_module
  - [x] _update_module
  - [ ] _install_git_module
  - [x] _install_local_module









---- ORIGINAL POST ---- 
I've been wondering about this for a while now and I would like to know if we should replace/update all the docstrings in opsdroid with the Google Style doc strings. 

I think this could help new and old contributors to contribute and commit to opsdroid since the Google Style docstrings give more information about every method/function and specifies clearly what sort of input the function/method expects, what will it return and what will be raised (if applicable).

The downsize of this style is that the length of every .py file will increase due to the doc strings, but since most IDE's allow you to hide those fields it shouldn't be too bad.

Here is a good example of Google Style Doc strings:  [Sphix 1.8.0+ - Google Style Docstrings](http://www.sphinx-doc.org/en/master/ext/example_google.html)

I would like to know what you all think about this idea and if its worth spending time on it.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `opsdroid/matchers.py`
Content:
```
1 """Decorator functions to use when creating skill modules."""
2 
3 import logging
4 
5 from opsdroid.const import REGEX_PARSE_SCORE_FACTOR
6 from opsdroid.helper import add_skill_attributes
7 
8 _LOGGER = logging.getLogger(__name__)
9 
10 
11 def match_event(event_type):
12     """Return event type matcher.
13 
14     Decorator that calls skill based on passed event_type.
15 
16     Args:
17         event_type (str): opsdroidstarted, message, typing, reaction, file, image
18     Returns:
19         Decorated function
20 
21     """
22 
23     def matcher(func):
24         """Add decorated function to list for event matching."""
25         func = add_skill_attributes(func)
26         func.matchers.append({"event_type": {"type": event_type}})
27         return func
28 
29     return matcher
30 
31 
32 def match_regex(
33     regex, case_sensitive=True, matching_condition="match", score_factor=None
34 ):
35     """Return regex match decorator.
36 
37     Decorator used to handle regex matching in skills. Decorated function will be called if regex
38     string matches. Matching can be customized based on the matching condition passed.
39 
40     Args:
41         regex (str): Regex expression as a string.
42         case_sensitive (bool): Flag to check for case sensitive matching, defaults to True.
43         matching_condition (str): Type of matching to be applied, can be "search", "match" or
44             "fullmatch"
45         score_factor (float): Score multiplier used by Rasa NLU skills
46 
47     Returns:
48         Decorated function
49 
50     """
51 
52     def matcher(func):
53         """Add decorated function to skills list for regex matching."""
54         func = add_skill_attributes(func)
55         func.matchers.append(
56             {
57                 "regex": {
58                     "expression": regex,
59                     "case_sensitive": case_sensitive,
60                     "matching_condition": matching_condition,
61                     "score_factor": score_factor or REGEX_PARSE_SCORE_FACTOR,
62                 }
63             }
64         )
65         return func
66 
67     return matcher
68 
69 
70 def match_parse(
71     format_str, case_sensitive=True, matching_condition="match", score_factor=None
72 ):
73     """Return parse match decorator.
74 
75     Decorator that matches the message from the user against a string with python format syntax.
76     If the string matches then the function is called. matching_condition can be set to customize
77     if string match should match format_str only at the beginning of input string or match in the
78     first location where format_str is found.
79 
80     Args:
81         format_str (str): A python format string to be matched.
82         case_sensitive (bool):  Boolean flag to check if matching should be case sensitive.
83         matching_condition (str): Type of matching to be applied, can be "match" or "search"
84         score_factor (float): Score multiplier used by Rasa NLU skills
85 
86     Returns:
87         Decorated function
88 
89     """
90 
91     def matcher(func):
92         """Add decorated function to skills list for parse matching."""
93         func = add_skill_attributes(func)
94         func.matchers.append(
95             {
96                 "parse_format": {
97                     "expression": format_str,
98                     "case_sensitive": case_sensitive,
99                     "matching_condition": matching_condition,
100                     "score_factor": score_factor or REGEX_PARSE_SCORE_FACTOR,
101                 }
102             }
103         )
104         return func
105 
106     return matcher
107 
108 
109 def match_dialogflow_action(action):
110     """Return Dialogflow action match decorator.
111 
112     Decorator that calls a function on any Dialogflow intent with a specified action.
113 
114     Args:
115         action (str): Dialogflow action
116 
117     Returns:
118         Decorated Function
119 
120     """
121 
122     def matcher(func):
123         """Add decorated function to skills list for Dialogflow matching."""
124         func = add_skill_attributes(func)
125         func.matchers.append({"dialogflow_action": action})
126         return func
127 
128     return matcher
129 
130 
131 def match_dialogflow_intent(intent):
132     """Return Dialogflow intent match decorator.
133 
134     Decorator that calls a function on specific Diaglogflow API intents.
135 
136     Args:
137         intent (str): Dialogflow intent name
138 
139     Returns:
140         Decorated Function
141 
142     """
143 
144     def matcher(func):
145         """Add decorated function to skills list for Dialogflow matching."""
146         func = add_skill_attributes(func)
147         func.matchers.append({"dialogflow_intent": intent})
148         return func
149 
150     return matcher
151 
152 
153 def match_luisai_intent(intent):
154     """Return luisai intent match decorator."""
155 
156     def matcher(func):
157         """Add decorated function to skills list for luisai matching."""
158         func = add_skill_attributes(func)
159         func.matchers.append({"luisai_intent": intent})
160         return func
161 
162     return matcher
163 
164 
165 def match_rasanlu(intent):
166     """Return Rasa NLU intent match decorator."""
167 
168     def matcher(func):
169         """Add decorated function to skills list for Rasa NLU matching."""
170         func = add_skill_attributes(func)
171         func.matchers.append({"rasanlu_intent": intent})
172         return func
173 
174     return matcher
175 
176 
177 def match_recastai(intent):
178     """Return recastai intent match decorator."""
179 
180     def matcher(func):
181         """Add decorated function to skills list for recastai matching."""
182         func = add_skill_attributes(func)
183         func.matchers.append({"sapcai_intent": intent})
184         return func
185 
186     _LOGGER.warning(
187         _(
188             "Recast.AI is now called SAP Conversational AI, "
189             "this matcher  will stop working in the future. "
190             "Use match_sapcai instead."
191         )
192     )
193     return matcher
194 
195 
196 def match_sapcai(intent):
197     """Return SAP Conversational AI intent match decorator."""
198 
199     def matcher(func):
200         """Add decorated function to skills list for SAPCAI matching."""
201         func = add_skill_attributes(func)
202         func.matchers.append({"sapcai_intent": intent})
203         return func
204 
205     return matcher
206 
207 
208 def match_watson(intent):
209     """Return watson intent match decorator."""
210 
211     def matcher(func):
212         """Add decorated function to skills list for watson matching."""
213         func = add_skill_attributes(func)
214         func.matchers.append({"watson_intent": intent})
215         return func
216 
217     return matcher
218 
219 
220 def match_witai(intent):
221     """Return witai intent match decorator."""
222 
223     def matcher(func):
224         """Add decorated function to skills list for witai matching."""
225         func = add_skill_attributes(func)
226         func.matchers.append({"witai_intent": intent})
227         return func
228 
229     return matcher
230 
231 
232 def match_crontab(crontab, timezone=None):
233     """Return crontab match decorator.
234 
235     Decorator that, after enabling crontab skill config, calls a function when cron timing interval
236     passes.
237 
238     Args:
239         crontab (str): cron timing string
240         timezone (str): timezone string, defaults to root configuration
241 
242     Returns:
243         Decorated Function
244 
245     """
246 
247     def matcher(func):
248         """Add decorated function to skills list for crontab matching."""
249         func = add_skill_attributes(func)
250         func.matchers.append({"crontab": crontab, "timezone": timezone})
251         return func
252 
253     return matcher
254 
255 
256 def match_webhook(webhook):
257     """Return webhook match decorator.
258 
259     Decorator that calls the decorated function when a POST is sent to
260     http://localhost:8080/skill/exampleskill/<webhook>. Does not need a message as input.
261 
262     Args:
263         webhook(str): webhook url
264 
265     Returns:
266         Decorated Function
267 
268     """
269 
270     def matcher(func):
271         """Add decorated function to skills list for webhook matching."""
272         func = add_skill_attributes(func)
273         func.matchers.append({"webhook": webhook})
274 
275         return func
276 
277     return matcher
278 
279 
280 def match_always(func=None):
281     """Return always match decorator.
282 
283     Decorator that parses every message as it is always running, it does not be need to be
284     configured explicitly.
285 
286     Returns:
287         Decorated Function
288 
289     """
290 
291     def matcher(func):
292         """Add decorated function to skills list for always matching."""
293         func = add_skill_attributes(func)
294         func.matchers.append({"always": True})
295         return func
296 
297     # Allow for decorator with or without parenthesis as there are no args.
298     if callable(func):
299         return matcher(func)
300     return matcher
301
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/opsdroid/matchers.py b/opsdroid/matchers.py
--- a/opsdroid/matchers.py
+++ b/opsdroid/matchers.py
@@ -151,7 +151,17 @@
 
 
 def match_luisai_intent(intent):
-    """Return luisai intent match decorator."""
+    """Return luis.ai intent match decorator.
+
+    Decorator that calls a function on specific luis.ai intents.
+
+    Args:
+        intent (str): luis.ai intent name
+
+    Returns:
+        Decorated Function
+
+    """
 
     def matcher(func):
         """Add decorated function to skills list for luisai matching."""
@@ -163,7 +173,17 @@
 
 
 def match_rasanlu(intent):
-    """Return Rasa NLU intent match decorator."""
+    """Return Rasa NLU intent match decorator.
+
+    Decorator that calls a function on specific Rasa NLU intents.
+
+    Args:
+        intent (str): Rasa NLU intent name
+
+    Returns:
+        Decorated Function
+
+    """
 
     def matcher(func):
         """Add decorated function to skills list for Rasa NLU matching."""
@@ -175,7 +195,17 @@
 
 
 def match_recastai(intent):
-    """Return recastai intent match decorator."""
+    """Return Recast.ai intent match decorator.
+
+    Decorator that calls a function on specific Recast.ai intents.
+
+    Args:
+        intent (str): Recast.ai intent name
+
+    Returns:
+        Decorated Function
+
+    """
 
     def matcher(func):
         """Add decorated function to skills list for recastai matching."""
@@ -194,7 +224,17 @@
 
 
 def match_sapcai(intent):
-    """Return SAP Conversational AI intent match decorator."""
+    """Return SAP Conversational AI intent match decorator.
+
+    Decorator that calls a function on specific SAP Conversational AI intents.
+
+    Args:
+        intent (str): SAP Conversational AI intent name
+
+    Returns:
+        Decorated Function
+
+    """
 
     def matcher(func):
         """Add decorated function to skills list for SAPCAI matching."""
@@ -206,7 +246,17 @@
 
 
 def match_watson(intent):
-    """Return watson intent match decorator."""
+    """Return IBM Watson intent match decorator.
+
+    Decorator that calls a function on specific IBM Watson intents.
+
+    Args:
+        intent (str): IBM Watson intent name
+
+    Returns:
+        Decorated Function
+
+    """
 
     def matcher(func):
         """Add decorated function to skills list for watson matching."""
@@ -218,7 +268,17 @@
 
 
 def match_witai(intent):
-    """Return witai intent match decorator."""
+    """Return wit.ai intent match decorator.
+
+    Decorator that calls a function on specific wit.ai intents.
+
+    Args:
+        intent (str): wit.ai intent name
+
+    Returns:
+        Decorated Function
+
+    """
 
     def matcher(func):
         """Add decorated function to skills list for witai matching."""

{"golden_diff": "diff --git a/opsdroid/matchers.py b/opsdroid/matchers.py\n--- a/opsdroid/matchers.py\n+++ b/opsdroid/matchers.py\n@@ -151,7 +151,17 @@\n \n \n def match_luisai_intent(intent):\n-    \"\"\"Return luisai intent match decorator.\"\"\"\n+    \"\"\"Return luis.ai intent match decorator.\n+\n+    Decorator that calls a function on specific luis.ai intents.\n+\n+    Args:\n+        intent (str): luis.ai intent name\n+\n+    Returns:\n+        Decorated Function\n+\n+    \"\"\"\n \n     def matcher(func):\n         \"\"\"Add decorated function to skills list for luisai matching.\"\"\"\n@@ -163,7 +173,17 @@\n \n \n def match_rasanlu(intent):\n-    \"\"\"Return Rasa NLU intent match decorator.\"\"\"\n+    \"\"\"Return Rasa NLU intent match decorator.\n+\n+    Decorator that calls a function on specific Rasa NLU intents.\n+\n+    Args:\n+        intent (str): Rasa NLU intent name\n+\n+    Returns:\n+        Decorated Function\n+\n+    \"\"\"\n \n     def matcher(func):\n         \"\"\"Add decorated function to skills list for Rasa NLU matching.\"\"\"\n@@ -175,7 +195,17 @@\n \n \n def match_recastai(intent):\n-    \"\"\"Return recastai intent match decorator.\"\"\"\n+    \"\"\"Return Recast.ai intent match decorator.\n+\n+    Decorator that calls a function on specific Recast.ai intents.\n+\n+    Args:\n+        intent (str): Recast.ai intent name\n+\n+    Returns:\n+        Decorated Function\n+\n+    \"\"\"\n \n     def matcher(func):\n         \"\"\"Add decorated function to skills list for recastai matching.\"\"\"\n@@ -194,7 +224,17 @@\n \n \n def match_sapcai(intent):\n-    \"\"\"Return SAP Conversational AI intent match decorator.\"\"\"\n+    \"\"\"Return SAP Conversational AI intent match decorator.\n+\n+    Decorator that calls a function on specific SAP Conversational AI intents.\n+\n+    Args:\n+        intent (str): SAP Conversational AI intent name\n+\n+    Returns:\n+        Decorated Function\n+\n+    \"\"\"\n \n     def matcher(func):\n         \"\"\"Add decorated function to skills list for SAPCAI matching.\"\"\"\n@@ -206,7 +246,17 @@\n \n \n def match_watson(intent):\n-    \"\"\"Return watson intent match decorator.\"\"\"\n+    \"\"\"Return IBM Watson intent match decorator.\n+\n+    Decorator that calls a function on specific IBM Watson intents.\n+\n+    Args:\n+        intent (str): IBM Watson intent name\n+\n+    Returns:\n+        Decorated Function\n+\n+    \"\"\"\n \n     def matcher(func):\n         \"\"\"Add decorated function to skills list for watson matching.\"\"\"\n@@ -218,7 +268,17 @@\n \n \n def match_witai(intent):\n-    \"\"\"Return witai intent match decorator.\"\"\"\n+    \"\"\"Return wit.ai intent match decorator.\n+\n+    Decorator that calls a function on specific wit.ai intents.\n+\n+    Args:\n+        intent (str): wit.ai intent name\n+\n+    Returns:\n+        Decorated Function\n+\n+    \"\"\"\n \n     def matcher(func):\n         \"\"\"Add decorated function to skills list for witai matching.\"\"\"\n", "issue": "Add Google Style Docstrings\nWe should implement Google Style Docstrings to every function, method, class in opsdroid. This style will support existing documentation and will help in the future by generating documentation automatically.\r\n\r\nThis consists in a bit of effort so this issue can be worked by more than one contributor, just make sure that everyone knows what you are working on in order to avoid other contributors spending time on something that you are working on.\r\n\r\nIf you are unfamiliar with the Google Style Docstrings I'd recommend that you check these resources:\r\n\r\n - [Sphix 1.8.0+ - Google Style Docstrings](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html)\r\n\r\n\r\n\r\nDocstrings that need to be updated:\r\n\r\n- main.py\r\n  - [x] configure_lang\r\n  - [ ] configure_log\r\n  - [ ] get_logging_level\r\n  - [ ] check_dependencies\r\n  - [ ] print_version\r\n  - [ ] print_example_config\r\n  - [ ] edit_files\r\n  - [x] welcome_message\r\n- ~~helper.py~~\r\n  - [x] get_opsdroid\r\n  - [x] del_rw\r\n  - [x] move_config_to_appdir\r\n- memory.py\r\n  - [x] Memory\r\n  - [x] get\r\n  - [x] put\r\n  - [x] _get_from_database\r\n  - [x] _put_to_database\r\n- message.py\r\n  - [x] Message\r\n  - [x]  __init__\r\n  - [x]  _thinking_delay\r\n  - [x]  _typing delay\r\n  - [x]  respond\r\n  - [x]  react\r\n- web.py\r\n  - [ ] Web\r\n  - [x] get_port\r\n  - [x] get_host\r\n  - [x]  get_ssl_context\r\n  - [ ]  start\r\n  - [ ]  build_response\r\n  - [ ]  web_index_handler\r\n  - [ ]  web_stats_handler\r\n- matchers.py\r\n  - [ ] match_regex\r\n  - [ ] match_apiai_action\r\n  - [ ] match_apiai_intent\r\n  - [ ]  match_dialogflow_action\r\n  - [ ]  match_dialogflow_intent\r\n  - [ ] match_luisai_intent\r\n  - [ ] match_rasanlu\r\n  - [ ] match_recastai\r\n  - [ ] match_witai\r\n  - [ ] match_crontab\r\n  - [ ] match_webhook\r\n  - [ ] match_always\r\n- core.py\r\n  - [ ] OpsDroid\r\n  - [ ] default_connector\r\n  - [ ] exit\r\n  - [ ] critical\r\n  - [ ]  call_stop\r\n  - [ ] disconnect\r\n  - [ ] stop\r\n  - [ ] load\r\n  - [ ] start_loop\r\n  - [x] setup_skills\r\n  - [ ] train_parsers\r\n  - [ ] start_connector_tasks\r\n  - [ ] start_database\r\n  - [ ] run_skill\r\n  - [ ] get_ranked_skills\r\n  - [ ] parse\r\n- loader.py\r\n  - [ ] Loader\r\n  - [x] import_module_from_spec\r\n  - [x] import_module\r\n  - [x] check_cache\r\n  - [x] build_module_import_path\r\n  - [x] build_module_install_path\r\n  - [x] git_clone\r\n  - [x] git_pull\r\n  - [x] pip_install_deps\r\n  - [x] create_default_config\r\n  - [x] load_config_file\r\n  - [ ] envvar_constructor\r\n  - [ ] include_constructor\r\n  - [x] setup_modules_directory\r\n  - [x] load_modules_from_config\r\n  - [x] _load_modules\r\n  - [x] _install_module\r\n  - [x] _update_module\r\n  - [ ] _install_git_module\r\n  - [x] _install_local_module\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n---- ORIGINAL POST ---- \r\nI've been wondering about this for a while now and I would like to know if we should replace/update all the docstrings in opsdroid with the Google Style doc strings. \r\n\r\nI think this could help new and old contributors to contribute and commit to opsdroid since the Google Style docstrings give more information about every method/function and specifies clearly what sort of input the function/method expects, what will it return and what will be raised (if applicable).\r\n\r\nThe downsize of this style is that the length of every .py file will increase due to the doc strings, but since most IDE's allow you to hide those fields it shouldn't be too bad.\r\n\r\nHere is a good example of Google Style Doc strings:  [Sphix 1.8.0+ - Google Style Docstrings](http://www.sphinx-doc.org/en/master/ext/example_google.html)\r\n\r\nI would like to know what you all think about this idea and if its worth spending time on it.\n", "before_files": [{"content": "\"\"\"Decorator functions to use when creating skill modules.\"\"\"\n\nimport logging\n\nfrom opsdroid.const import REGEX_PARSE_SCORE_FACTOR\nfrom opsdroid.helper import add_skill_attributes\n\n_LOGGER = logging.getLogger(__name__)\n\n\ndef match_event(event_type):\n    \"\"\"Return event type matcher.\n\n    Decorator that calls skill based on passed event_type.\n\n    Args:\n        event_type (str): opsdroidstarted, message, typing, reaction, file, image\n    Returns:\n        Decorated function\n\n    \"\"\"\n\n    def matcher(func):\n        \"\"\"Add decorated function to list for event matching.\"\"\"\n        func = add_skill_attributes(func)\n        func.matchers.append({\"event_type\": {\"type\": event_type}})\n        return func\n\n    return matcher\n\n\ndef match_regex(\n    regex, case_sensitive=True, matching_condition=\"match\", score_factor=None\n):\n    \"\"\"Return regex match decorator.\n\n    Decorator used to handle regex matching in skills. Decorated function will be called if regex\n    string matches. Matching can be customized based on the matching condition passed.\n\n    Args:\n        regex (str): Regex expression as a string.\n        case_sensitive (bool): Flag to check for case sensitive matching, defaults to True.\n        matching_condition (str): Type of matching to be applied, can be \"search\", \"match\" or\n            \"fullmatch\"\n        score_factor (float): Score multiplier used by Rasa NLU skills\n\n    Returns:\n        Decorated function\n\n    \"\"\"\n\n    def matcher(func):\n        \"\"\"Add decorated function to skills list for regex matching.\"\"\"\n        func = add_skill_attributes(func)\n        func.matchers.append(\n            {\n                \"regex\": {\n                    \"expression\": regex,\n                    \"case_sensitive\": case_sensitive,\n                    \"matching_condition\": matching_condition,\n                    \"score_factor\": score_factor or REGEX_PARSE_SCORE_FACTOR,\n                }\n            }\n        )\n        return func\n\n    return matcher\n\n\ndef match_parse(\n    format_str, case_sensitive=True, matching_condition=\"match\", score_factor=None\n):\n    \"\"\"Return parse match decorator.\n\n    Decorator that matches the message from the user against a string with python format syntax.\n    If the string matches then the function is called. matching_condition can be set to customize\n    if string match should match format_str only at the beginning of input string or match in the\n    first location where format_str is found.\n\n    Args:\n        format_str (str): A python format string to be matched.\n        case_sensitive (bool):  Boolean flag to check if matching should be case sensitive.\n        matching_condition (str): Type of matching to be applied, can be \"match\" or \"search\"\n        score_factor (float): Score multiplier used by Rasa NLU skills\n\n    Returns:\n        Decorated function\n\n    \"\"\"\n\n    def matcher(func):\n        \"\"\"Add decorated function to skills list for parse matching.\"\"\"\n        func = add_skill_attributes(func)\n        func.matchers.append(\n            {\n                \"parse_format\": {\n                    \"expression\": format_str,\n                    \"case_sensitive\": case_sensitive,\n                    \"matching_condition\": matching_condition,\n                    \"score_factor\": score_factor or REGEX_PARSE_SCORE_FACTOR,\n                }\n            }\n        )\n        return func\n\n    return matcher\n\n\ndef match_dialogflow_action(action):\n    \"\"\"Return Dialogflow action match decorator.\n\n    Decorator that calls a function on any Dialogflow intent with a specified action.\n\n    Args:\n        action (str): Dialogflow action\n\n    Returns:\n        Decorated Function\n\n    \"\"\"\n\n    def matcher(func):\n        \"\"\"Add decorated function to skills list for Dialogflow matching.\"\"\"\n        func = add_skill_attributes(func)\n        func.matchers.append({\"dialogflow_action\": action})\n        return func\n\n    return matcher\n\n\ndef match_dialogflow_intent(intent):\n    \"\"\"Return Dialogflow intent match decorator.\n\n    Decorator that calls a function on specific Diaglogflow API intents.\n\n    Args:\n        intent (str): Dialogflow intent name\n\n    Returns:\n        Decorated Function\n\n    \"\"\"\n\n    def matcher(func):\n        \"\"\"Add decorated function to skills list for Dialogflow matching.\"\"\"\n        func = add_skill_attributes(func)\n        func.matchers.append({\"dialogflow_intent\": intent})\n        return func\n\n    return matcher\n\n\ndef match_luisai_intent(intent):\n    \"\"\"Return luisai intent match decorator.\"\"\"\n\n    def matcher(func):\n        \"\"\"Add decorated function to skills list for luisai matching.\"\"\"\n        func = add_skill_attributes(func)\n        func.matchers.append({\"luisai_intent\": intent})\n        return func\n\n    return matcher\n\n\ndef match_rasanlu(intent):\n    \"\"\"Return Rasa NLU intent match decorator.\"\"\"\n\n    def matcher(func):\n        \"\"\"Add decorated function to skills list for Rasa NLU matching.\"\"\"\n        func = add_skill_attributes(func)\n        func.matchers.append({\"rasanlu_intent\": intent})\n        return func\n\n    return matcher\n\n\ndef match_recastai(intent):\n    \"\"\"Return recastai intent match decorator.\"\"\"\n\n    def matcher(func):\n        \"\"\"Add decorated function to skills list for recastai matching.\"\"\"\n        func = add_skill_attributes(func)\n        func.matchers.append({\"sapcai_intent\": intent})\n        return func\n\n    _LOGGER.warning(\n        _(\n            \"Recast.AI is now called SAP Conversational AI, \"\n            \"this matcher  will stop working in the future. \"\n            \"Use match_sapcai instead.\"\n        )\n    )\n    return matcher\n\n\ndef match_sapcai(intent):\n    \"\"\"Return SAP Conversational AI intent match decorator.\"\"\"\n\n    def matcher(func):\n        \"\"\"Add decorated function to skills list for SAPCAI matching.\"\"\"\n        func = add_skill_attributes(func)\n        func.matchers.append({\"sapcai_intent\": intent})\n        return func\n\n    return matcher\n\n\ndef match_watson(intent):\n    \"\"\"Return watson intent match decorator.\"\"\"\n\n    def matcher(func):\n        \"\"\"Add decorated function to skills list for watson matching.\"\"\"\n        func = add_skill_attributes(func)\n        func.matchers.append({\"watson_intent\": intent})\n        return func\n\n    return matcher\n\n\ndef match_witai(intent):\n    \"\"\"Return witai intent match decorator.\"\"\"\n\n    def matcher(func):\n        \"\"\"Add decorated function to skills list for witai matching.\"\"\"\n        func = add_skill_attributes(func)\n        func.matchers.append({\"witai_intent\": intent})\n        return func\n\n    return matcher\n\n\ndef match_crontab(crontab, timezone=None):\n    \"\"\"Return crontab match decorator.\n\n    Decorator that, after enabling crontab skill config, calls a function when cron timing interval\n    passes.\n\n    Args:\n        crontab (str): cron timing string\n        timezone (str): timezone string, defaults to root configuration\n\n    Returns:\n        Decorated Function\n\n    \"\"\"\n\n    def matcher(func):\n        \"\"\"Add decorated function to skills list for crontab matching.\"\"\"\n        func = add_skill_attributes(func)\n        func.matchers.append({\"crontab\": crontab, \"timezone\": timezone})\n        return func\n\n    return matcher\n\n\ndef match_webhook(webhook):\n    \"\"\"Return webhook match decorator.\n\n    Decorator that calls the decorated function when a POST is sent to\n    http://localhost:8080/skill/exampleskill/<webhook>. Does not need a message as input.\n\n    Args:\n        webhook(str): webhook url\n\n    Returns:\n        Decorated Function\n\n    \"\"\"\n\n    def matcher(func):\n        \"\"\"Add decorated function to skills list for webhook matching.\"\"\"\n        func = add_skill_attributes(func)\n        func.matchers.append({\"webhook\": webhook})\n\n        return func\n\n    return matcher\n\n\ndef match_always(func=None):\n    \"\"\"Return always match decorator.\n\n    Decorator that parses every message as it is always running, it does not be need to be\n    configured explicitly.\n\n    Returns:\n        Decorated Function\n\n    \"\"\"\n\n    def matcher(func):\n        \"\"\"Add decorated function to skills list for always matching.\"\"\"\n        func = add_skill_attributes(func)\n        func.matchers.append({\"always\": True})\n        return func\n\n    # Allow for decorator with or without parenthesis as there are no args.\n    if callable(func):\n        return matcher(func)\n    return matcher\n", "path": "opsdroid/matchers.py"}], "after_files": [{"content": "\"\"\"Decorator functions to use when creating skill modules.\"\"\"\n\nimport logging\n\nfrom opsdroid.const import REGEX_PARSE_SCORE_FACTOR\nfrom opsdroid.helper import add_skill_attributes\n\n_LOGGER = logging.getLogger(__name__)\n\n\ndef match_event(event_type):\n    \"\"\"Return event type matcher.\n\n    Decorator that calls skill based on passed event_type.\n\n    Args:\n        event_type (str): opsdroidstarted, message, typing, reaction, file, image\n    Returns:\n        Decorated function\n\n    \"\"\"\n\n    def matcher(func):\n        \"\"\"Add decorated function to list for event matching.\"\"\"\n        func = add_skill_attributes(func)\n        func.matchers.append({\"event_type\": {\"type\": event_type}})\n        return func\n\n    return matcher\n\n\ndef match_regex(\n    regex, case_sensitive=True, matching_condition=\"match\", score_factor=None\n):\n    \"\"\"Return regex match decorator.\n\n    Decorator used to handle regex matching in skills. Decorated function will be called if regex\n    string matches. Matching can be customized based on the matching condition passed.\n\n    Args:\n        regex (str): Regex expression as a string.\n        case_sensitive (bool): Flag to check for case sensitive matching, defaults to True.\n        matching_condition (str): Type of matching to be applied, can be \"search\", \"match\" or\n            \"fullmatch\"\n        score_factor (float): Score multiplier used by Rasa NLU skills\n\n    Returns:\n        Decorated function\n\n    \"\"\"\n\n    def matcher(func):\n        \"\"\"Add decorated function to skills list for regex matching.\"\"\"\n        func = add_skill_attributes(func)\n        func.matchers.append(\n            {\n                \"regex\": {\n                    \"expression\": regex,\n                    \"case_sensitive\": case_sensitive,\n                    \"matching_condition\": matching_condition,\n                    \"score_factor\": score_factor or REGEX_PARSE_SCORE_FACTOR,\n                }\n            }\n        )\n        return func\n\n    return matcher\n\n\ndef match_parse(\n    format_str, case_sensitive=True, matching_condition=\"match\", score_factor=None\n):\n    \"\"\"Return parse match decorator.\n\n    Decorator that matches the message from the user against a string with python format syntax.\n    If the string matches then the function is called. matching_condition can be set to customize\n    if string match should match format_str only at the beginning of input string or match in the\n    first location where format_str is found.\n\n    Args:\n        format_str (str): A python format string to be matched.\n        case_sensitive (bool):  Boolean flag to check if matching should be case sensitive.\n        matching_condition (str): Type of matching to be applied, can be \"match\" or \"search\"\n        score_factor (float): Score multiplier used by Rasa NLU skills\n\n    Returns:\n        Decorated function\n\n    \"\"\"\n\n    def matcher(func):\n        \"\"\"Add decorated function to skills list for parse matching.\"\"\"\n        func = add_skill_attributes(func)\n        func.matchers.append(\n            {\n                \"parse_format\": {\n                    \"expression\": format_str,\n                    \"case_sensitive\": case_sensitive,\n                    \"matching_condition\": matching_condition,\n                    \"score_factor\": score_factor or REGEX_PARSE_SCORE_FACTOR,\n                }\n            }\n        )\n        return func\n\n    return matcher\n\n\ndef match_dialogflow_action(action):\n    \"\"\"Return Dialogflow action match decorator.\n\n    Decorator that calls a function on any Dialogflow intent with a specified action.\n\n    Args:\n        action (str): Dialogflow action\n\n    Returns:\n        Decorated Function\n\n    \"\"\"\n\n    def matcher(func):\n        \"\"\"Add decorated function to skills list for Dialogflow matching.\"\"\"\n        func = add_skill_attributes(func)\n        func.matchers.append({\"dialogflow_action\": action})\n        return func\n\n    return matcher\n\n\ndef match_dialogflow_intent(intent):\n    \"\"\"Return Dialogflow intent match decorator.\n\n    Decorator that calls a function on specific Diaglogflow API intents.\n\n    Args:\n        intent (str): Dialogflow intent name\n\n    Returns:\n        Decorated Function\n\n    \"\"\"\n\n    def matcher(func):\n        \"\"\"Add decorated function to skills list for Dialogflow matching.\"\"\"\n        func = add_skill_attributes(func)\n        func.matchers.append({\"dialogflow_intent\": intent})\n        return func\n\n    return matcher\n\n\ndef match_luisai_intent(intent):\n    \"\"\"Return luis.ai intent match decorator.\n\n    Decorator that calls a function on specific luis.ai intents.\n\n    Args:\n        intent (str): luis.ai intent name\n\n    Returns:\n        Decorated Function\n\n    \"\"\"\n\n    def matcher(func):\n        \"\"\"Add decorated function to skills list for luisai matching.\"\"\"\n        func = add_skill_attributes(func)\n        func.matchers.append({\"luisai_intent\": intent})\n        return func\n\n    return matcher\n\n\ndef match_rasanlu(intent):\n    \"\"\"Return Rasa NLU intent match decorator.\n\n    Decorator that calls a function on specific Rasa NLU intents.\n\n    Args:\n        intent (str): Rasa NLU intent name\n\n    Returns:\n        Decorated Function\n\n    \"\"\"\n\n    def matcher(func):\n        \"\"\"Add decorated function to skills list for Rasa NLU matching.\"\"\"\n        func = add_skill_attributes(func)\n        func.matchers.append({\"rasanlu_intent\": intent})\n        return func\n\n    return matcher\n\n\ndef match_recastai(intent):\n    \"\"\"Return Recast.ai intent match decorator.\n\n    Decorator that calls a function on specific Recast.ai intents.\n\n    Args:\n        intent (str): Recast.ai intent name\n\n    Returns:\n        Decorated Function\n\n    \"\"\"\n\n    def matcher(func):\n        \"\"\"Add decorated function to skills list for recastai matching.\"\"\"\n        func = add_skill_attributes(func)\n        func.matchers.append({\"sapcai_intent\": intent})\n        return func\n\n    _LOGGER.warning(\n        _(\n            \"Recast.AI is now called SAP Conversational AI, \"\n            \"this matcher  will stop working in the future. \"\n            \"Use match_sapcai instead.\"\n        )\n    )\n    return matcher\n\n\ndef match_sapcai(intent):\n    \"\"\"Return SAP Conversational AI intent match decorator.\n\n    Decorator that calls a function on specific SAP Conversational AI intents.\n\n    Args:\n        intent (str): SAP Conversational AI intent name\n\n    Returns:\n        Decorated Function\n\n    \"\"\"\n\n    def matcher(func):\n        \"\"\"Add decorated function to skills list for SAPCAI matching.\"\"\"\n        func = add_skill_attributes(func)\n        func.matchers.append({\"sapcai_intent\": intent})\n        return func\n\n    return matcher\n\n\ndef match_watson(intent):\n    \"\"\"Return IBM Watson intent match decorator.\n\n    Decorator that calls a function on specific IBM Watson intents.\n\n    Args:\n        intent (str): IBM Watson intent name\n\n    Returns:\n        Decorated Function\n\n    \"\"\"\n\n    def matcher(func):\n        \"\"\"Add decorated function to skills list for watson matching.\"\"\"\n        func = add_skill_attributes(func)\n        func.matchers.append({\"watson_intent\": intent})\n        return func\n\n    return matcher\n\n\ndef match_witai(intent):\n    \"\"\"Return wit.ai intent match decorator.\n\n    Decorator that calls a function on specific wit.ai intents.\n\n    Args:\n        intent (str): wit.ai intent name\n\n    Returns:\n        Decorated Function\n\n    \"\"\"\n\n    def matcher(func):\n        \"\"\"Add decorated function to skills list for witai matching.\"\"\"\n        func = add_skill_attributes(func)\n        func.matchers.append({\"witai_intent\": intent})\n        return func\n\n    return matcher\n\n\ndef match_crontab(crontab, timezone=None):\n    \"\"\"Return crontab match decorator.\n\n    Decorator that, after enabling crontab skill config, calls a function when cron timing interval\n    passes.\n\n    Args:\n        crontab (str): cron timing string\n        timezone (str): timezone string, defaults to root configuration\n\n    Returns:\n        Decorated Function\n\n    \"\"\"\n\n    def matcher(func):\n        \"\"\"Add decorated function to skills list for crontab matching.\"\"\"\n        func = add_skill_attributes(func)\n        func.matchers.append({\"crontab\": crontab, \"timezone\": timezone})\n        return func\n\n    return matcher\n\n\ndef match_webhook(webhook):\n    \"\"\"Return webhook match decorator.\n\n    Decorator that calls the decorated function when a POST is sent to\n    http://localhost:8080/skill/exampleskill/<webhook>. Does not need a message as input.\n\n    Args:\n        webhook(str): webhook url\n\n    Returns:\n        Decorated Function\n\n    \"\"\"\n\n    def matcher(func):\n        \"\"\"Add decorated function to skills list for webhook matching.\"\"\"\n        func = add_skill_attributes(func)\n        func.matchers.append({\"webhook\": webhook})\n\n        return func\n\n    return matcher\n\n\ndef match_always(func=None):\n    \"\"\"Return always match decorator.\n\n    Decorator that parses every message as it is always running, it does not be need to be\n    configured explicitly.\n\n    Returns:\n        Decorated Function\n\n    \"\"\"\n\n    def matcher(func):\n        \"\"\"Add decorated function to skills list for always matching.\"\"\"\n        func = add_skill_attributes(func)\n        func.matchers.append({\"always\": True})\n        return func\n\n    # Allow for decorator with or without parenthesis as there are no args.\n    if callable(func):\n        return matcher(func)\n    return matcher\n", "path": "opsdroid/matchers.py"}]}