Repository: opsdroid/opsdroid

Issue:
Slack Connector is logging an error which is not really an error
<!-- Before you post an issue or if you are unsure about something join our matrix channel https://app.element.io/#/room/#opsdroid-general:matrix.org and ask away! We are more than happy to help you. -->
# Description
Every time opsdroid responds in a thread for the slack connector, the log is throwing an error in the following form:

```code
ERROR    Payload: {...} is not  implemented. Event wont be parsed
```

This is not really an error, but just a misplaced log message that should be a debug message.

The [create_event](https://github.com/opsdroid/opsdroid/blob/master/opsdroid/connector/slack/connector.py#L190) method from the slack connector is returning an empty event.  The [event_handler](https://github.com/opsdroid/opsdroid/blob/master/opsdroid/connector/slack/connector.py#L195) checks that the event is not empty and throws the error, which should not be. If the event returns empty (which is valid) the event handler should not parse the event. 

Since it's labeled as an error, every time there is a response in a thread from opsdroid, the ERROR is logged, which creates a lot of false entries in a production log.

## Steps to Reproduce

Create a skill where opsdroid replies inside a thread

## Expected Functionality
The error log should not appear as it's not really an error


## Experienced Functionality
The logger is longing an ERROR message which is not really an error


## Versions
- **0.26:**





<!-- Love opsdroid? Please consider supporting our collective:
 +👉  https://opencollective.com/opsdroid/donate -->



Discussion:

Resolving patch:
diff --git a/opsdroid/connector/slack/connector.py b/opsdroid/connector/slack/connector.py
--- a/opsdroid/connector/slack/connector.py
+++ b/opsdroid/connector/slack/connector.py
@@ -8,8 +8,11 @@
 
 import aiohttp
 import certifi
+import opsdroid.events
 from emoji import demojize
-
+from opsdroid.connector import Connector, register_event
+from opsdroid.connector.slack.create_events import SlackEventCreator
+from opsdroid.connector.slack.events import Blocks, EditedBlocks
 from slack_sdk.errors import SlackApiError
 from slack_sdk.socket_mode.aiohttp import SocketModeClient
 from slack_sdk.socket_mode.request import SocketModeRequest
@@ -17,11 +20,6 @@
 from slack_sdk.web.async_client import AsyncWebClient
 from voluptuous import Required
 
-import opsdroid.events
-from opsdroid.connector import Connector, register_event
-from opsdroid.connector.slack.create_events import SlackEventCreator
-from opsdroid.connector.slack.events import Blocks, EditedBlocks
-
 _LOGGER = logging.getLogger(__name__)
 
 _USE_BOT_TOKEN_MSG = (
@@ -139,6 +137,7 @@ async def disconnect(self):
 
         Cancels the event queue worker task and disconnects the
         socket_mode_client if socket mode was enabled."""
+
         if self._event_queue_task:
             self._event_queue_task.cancel()
             await asyncio.gather(self._event_queue_task, return_exceptions=True)
@@ -177,6 +176,7 @@ def _generate_base_data(self, event: opsdroid.events.Event) -> dict:
                     data["thread_ts"] = raw_event["thread_ts"]
             elif self.start_thread:
                 data["thread_ts"] = event.linked_event.event_id
+
         return data
 
     async def event_handler(self, payload):
@@ -191,21 +191,19 @@ async def event_handler(self, payload):
             else:
                 event = await self._event_creator.create_event(payload, None)
 
-        if not event:
-            _LOGGER.error(
-                "Payload: %s is not implemented. Event wont be parsed", payload
-            )
+        if event:
+            if isinstance(event, list):
+                for e in event:
+                    _LOGGER.debug(f"Got slack event: {e}")
+                    await self.opsdroid.parse(e)
 
-            return
-
-        if isinstance(event, list):
-            for e in event:
-                _LOGGER.debug(f"Got slack event: {e}")
-                await self.opsdroid.parse(e)
-
-        if isinstance(event, opsdroid.events.Event):
-            _LOGGER.debug(f"Got slack event: {event}")
-            await self.opsdroid.parse(event)
+            if isinstance(event, opsdroid.events.Event):
+                _LOGGER.debug(f"Got slack event: {event}")
+                await self.opsdroid.parse(event)
+        else:
+            _LOGGER.debug(
+                "Event returned empty for payload: %s. Event was not parsed", payload
+            )
 
     async def socket_event_handler(
         self, client: SocketModeClient, req: SocketModeRequest


Test patch: