#!/usr/bin/env python3
import logging
import sys

import click 

from notifier.slack import get_slack_bot_token, send_msg_to_channel

@click.command()
@click.option('-c', '--channel', required=True, type=str)
@click.option('-t', '--text', required=True, type=str)
def msg_to_channel(channel, text):
    token = get_slack_bot_token()
    if not token:
        logging.error(f'Slack token is not set exiting!')
        sys.exit(1)
    else:
        send_msg_to_channel(token, channel, text)


if __name__ == "__main__":
    msg_to_channel()
