diff --git a/apprise/plugins/NotifyTelegram.py b/apprise/plugins/NotifyTelegram.py index 03bc36c6..dbea79b1 100644 --- a/apprise/plugins/NotifyTelegram.py +++ b/apprise/plugins/NotifyTelegram.py @@ -297,7 +297,6 @@ class NotifyTelegram(NotifyBase): 'name': _('Target Chat ID'), 'type': 'string', 'map_to': 'targets', - 'map_to': 'targets', 'regex': (r'^((-?[0-9]{1,32})|([a-z_-][a-z0-9_-]+))$', 'i'), }, 'targets': { @@ -916,7 +915,7 @@ class NotifyTelegram(NotifyBase): """ Returns the number of targets associated with this notification """ - return len(self.targets) + return 1 if not self.targets else len(self.targets) @staticmethod def parse_url(url): diff --git a/test/test_plugin_discord.py b/test/test_plugin_discord.py index 848c7c31..ea634c3b 100644 --- a/test/test_plugin_discord.py +++ b/test/test_plugin_discord.py @@ -298,14 +298,19 @@ def test_plugin_discord_notifications(mock_post): @mock.patch('requests.post') -def test_plugin_discord_general(mock_post): +@mock.patch('time.sleep') +def test_plugin_discord_general(mock_sleep, mock_post): """ NotifyDiscord() General Checks """ + # Prevent throttling + mock_sleep.return_value = True + # Turn off clock skew for local testing NotifyDiscord.clock_skew = timedelta(seconds=0) + # Epoch time: epoch = datetime.fromtimestamp(0, timezone.utc)