Skip to content

Commit

Permalink
Added a class of telegram destination to support a new channel and cu…
Browse files Browse the repository at this point in the history
…stom webhook to select message

Signed-off-by: danielkyalo599 <[email protected]>
  • Loading branch information
dankyalo599 committed Feb 13, 2023
1 parent 7e622df commit 5fbb292
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ package org.opensearch.notifications.spi.model.destination
* Supported notification destinations
*/
enum class DestinationType {
CHIME, SLACK, CUSTOM_WEBHOOK, SMTP, SES, SNS
CHIME, SLACK, CUSTOM_WEBHOOK, SMTP, SES, SNS, TELEGRAM
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

package org.opensearch.notifications.spi.model.destination
/*
This class holds the contents of a Telegram destination
*/
class TelegramDestination(
val token: String,
val chatId: Long,
val url: String = "https://api.telegram.org/bot$token/sendMessage?chat_id=$chatId"
) : WebhookDestination(url, DestinationType.TELEGRAM)

0 comments on commit 5fbb292

Please sign in to comment.