class Fastlane::Actions::TelegramAction

Public Class Methods

authors() click to toggle source
# File lib/fastlane-ext/telegram.rb, line 80
def self.authors
  %w[sroik elfenlaid]
end
available_options() click to toggle source
# File lib/fastlane-ext/telegram.rb, line 27
def self.available_options
  [
    FastlaneCore::ConfigItem.new(
      key: :bot_api_token,
      env_name: 'FL_TELEGRAM_BOT_API_TOKEN',
      description: 'API Token for telegram bot',
      verify_block: proc do |value|
        msg = "No bot API token for TelegramAction given, pass using `bot_api_token: 'token'`"
        UI.user_error!(msg) unless value && !value.empty?
      end
    ),
    FastlaneCore::ConfigItem.new(
      key: :message,
      env_name: 'FL_TELEGRAM_MESSAGE',
      description: 'The message that should be displayed on Telegram',
      optional: true
    ),
    FastlaneCore::ConfigItem.new(
      key: :chat_id,
      env_name: 'FL_TELEGRAM_CHAT_ID',
      description: 'telegram chat id',
      verify_block: proc do |value|
        msg = "No chat id for TelegramAction given, pass using `chat_id: 'chat id'`"
        UI.user_error!(msg) unless value && !value.empty?
      end
    ),
    FastlaneCore::ConfigItem.new(
      key: :parse_mode,
      env_name: 'FL_TELEGRAM_MESSAGE_PARSE_MODE',
      description: 'telegram message parse mode',
      optional: true
    ),
    FastlaneCore::ConfigItem.new(
      key: :silent,
      env_name: 'FL_TELEGRAM_MESSAGE_SILENT_NOTIFY',
      description: 'disables telegram message notifications',
      optional: true
    )
  ]
end
category() click to toggle source
# File lib/fastlane-ext/telegram.rb, line 88
def self.category
  :notifications
end
description() click to toggle source

@!group Documentation

# File lib/fastlane-ext/telegram.rb, line 19
def self.description
  'Send a success/error message to your Telegram group'
end
details() click to toggle source
# File lib/fastlane-ext/telegram.rb, line 23
def self.details
  'Send a success/error message to your Telegram group'
end
example_code() click to toggle source
# File lib/fastlane-ext/telegram.rb, line 68
def self.example_code
  [
    'telegram(message: "App successfully released!")',
    'telegram(
      bot_api_token: "bot api token here",
      chat_id: "telegram chat id here",
      message: "message here"
      parse_mode: "message parse mode here"
    )'
  ]
end
is_supported?(platform) click to toggle source
# File lib/fastlane-ext/telegram.rb, line 84
def self.is_supported?(platform)
  platform == :ios
end
run(params) click to toggle source
# File lib/fastlane-ext/telegram.rb, line 10
def self.run(params)
  notifier = TelegramNotifier.new(bot_api_token: params[:bot_api_token], chat_id: params[:chat_id])
  notifier.notify(message: params[:message], parse_mode: params[:parse_mode], silent: params[:silent])
end