import requests

from slackclient import SlackClient

from kalliope import Utils
from kalliope.core.NeuronModule import NeuronModule, MissingParameterException

Slack_Actions = (
    "POST",
    "READ",
    "USERS"
)


class Slack(NeuronModule):
    def __init__(self, **kwargs):

        super(Slack, self).__init__(**kwargs)

        # parameters
        self.action = kwargs.get('action', None)
        self.token = kwargs.get('slack_token', None)
        self.channel = kwargs.get('channel', None)
        self.message = kwargs.get('message', None)
        self.nb_messages = int(kwargs.get('nb_messages', 10))  # Int
        self.only_connected = bool(kwargs.get('only_connected', True))
        
        # check parameters
        if self._is_parameters_ok():