def __init__(self, webhook_obj, alert_recipient=None):  # pragma: no cover
        """HackyDiscordHandler init

        Args:
            webhook_obj (:obj:`DiscordWebhook`): discord webhook has all the info for connection
            alert_recipients (`str`:<@int>, optional): user/group to notify

        """
        logging.Handler.__init__(self)
        self.webhook_obj = webhook_obj
        if not self.webhook_obj: # test if it's configured
            raise Exception('Webhook not configured.')

        self.api_url = webhook_obj.webhook_url
        self.alert_recipient = alert_recipient
        self.alert_length = 0
        if self.alert_recipient:
            self.alert_length = len(self.alert_recipient)
def __init__ ( self , webhook_obj , alert_recipient = None ) : logging . Handler . __init__ ( self ) self . webhook_obj = webhook_obj if not self . webhook_obj : raise Exception ( 'Webhook not configured.' ) self . api_url = webhook_obj . webhook_url self . alert_recipient = alert_recipient self . alert_length = 0 if self . alert_recipient : self . alert_length = len ( self . alert_recipient )
HackyDiscordHandler init

        Args:
            webhook_obj (:obj:`DiscordWebhook`): discord webhook has all the info for connection
            alert_recipients (`str`:<@int>, optional): user/group to notify