def discard_event(event: events.Event, bot_id: str = None) -> bool:
if event["<STR_LIT:type>"] in SKIP_EVENTS:<EOL><INDENT>return True<EOL><DEDENT>elif bot_id and isinstance(event, events.Message):<EOL><INDENT>if event.get("<STR_LIT>") == bot_id:<EOL><INDENT>LOG.debug("<STR_LIT>", event)<EOL>return True<EOL><DEDENT>elif "<STR_LIT:message>" in event and event["<STR_LIT:message>"].get("<STR_LIT>") == bot_id:<EOL><INDENT>LOG.debug("<STR_LIT>", event)<EOL>return True<EOL><DEDENT><DEDENT>return False<EOL>
Check if the incoming event needs to be discarded

Args:
    event: Incoming :class:`slack.events.Event`
    bot_id: Id of connected bot

Returns:
    boolean