mirror of https://github.com/caronc/apprise
Slack Notification plugin to honor url format arg
parent
426092cf3f
commit
b2d5c9ae09
|
@ -44,6 +44,7 @@ from time import time
|
||||||
from .NotifyBase import NotifyBase
|
from .NotifyBase import NotifyBase
|
||||||
from ..common import NotifyImageSize
|
from ..common import NotifyImageSize
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
|
from ..common import NotifyFormat
|
||||||
|
|
||||||
# Token required as part of the API request
|
# Token required as part of the API request
|
||||||
# /AAAAAAAAA/........./........................
|
# /AAAAAAAAA/........./........................
|
||||||
|
@ -98,6 +99,8 @@ class NotifySlack(NotifyBase):
|
||||||
# The maximum allowable characters allowed in the body per message
|
# The maximum allowable characters allowed in the body per message
|
||||||
body_maxlen = 1000
|
body_maxlen = 1000
|
||||||
|
|
||||||
|
notify_format = NotifyFormat.MARKDOWN
|
||||||
|
|
||||||
def __init__(self, token_a, token_b, token_c, channels, **kwargs):
|
def __init__(self, token_a, token_b, token_c, channels, **kwargs):
|
||||||
"""
|
"""
|
||||||
Initialize Slack Object
|
Initialize Slack Object
|
||||||
|
@ -233,7 +236,7 @@ class NotifySlack(NotifyBase):
|
||||||
'channel': _channel,
|
'channel': _channel,
|
||||||
'username': self.user if self.user else SLACK_DEFAULT_USER,
|
'username': self.user if self.user else SLACK_DEFAULT_USER,
|
||||||
# Use Markdown language
|
# Use Markdown language
|
||||||
'mrkdwn': True,
|
'mrkdwn': (self.notify_format == NotifyFormat.MARKDOWN),
|
||||||
'attachments': [{
|
'attachments': [{
|
||||||
'title': title,
|
'title': title,
|
||||||
'text': body,
|
'text': body,
|
||||||
|
|
Loading…
Reference in New Issue