Class: Fastlane::Actions::ZeevaDiscordAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::ZeevaDiscordAction
- Defined in:
- lib/fastlane/plugin/zeeva_discord/actions/zeeva_discord_action.rb
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .details ⇒ Object
- .get_message_body(buildName, buildType, platform, buildContent) ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .return_value ⇒ Object
- .run(params) ⇒ Object
- .run_application_bot(token, appId, channelId, messageBody) ⇒ Object
Class Method Details
.authors ⇒ Object
52 53 54 |
# File 'lib/fastlane/plugin/zeeva_discord/actions/zeeva_discord_action.rb', line 52 def self. ["Yazan Tarifi"] end |
.available_options ⇒ Object
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/fastlane/plugin/zeeva_discord/actions/zeeva_discord_action.rb', line 65 def self. [ FastlaneCore::ConfigItem.new( key: :server_token, env_name: "SERVER_TOKEN", description: "The Private Current Server Token", optional: false, type: String ), FastlaneCore::ConfigItem.new( key: :client_id, env_name: "CLIENT_ID", description: "The Client ID for Your Bot", optional: false, type: String ), FastlaneCore::ConfigItem.new( key: :channel_id, env_name: "CHANNEL_ID", description: "The Target Channel ID The Bot Will Send the Message on", optional: false, type: String ), FastlaneCore::ConfigItem.new( key: :build_name, env_name: "BUILD_NAME", description: "The Build Name that Currently Running", optional: false, type: String ), FastlaneCore::ConfigItem.new( key: :build_type, env_name: "BUILD_TYPE", description: "The Build Type that Currently Running", optional: false, type: String ), FastlaneCore::ConfigItem.new( key: :platform_code, env_name: "PLATFORM_CODE", description: "The Platform that Currently Running Ex: Android, IOS, Mac", optional: false, type: String ) ] end |
.description ⇒ Object
48 49 50 |
# File 'lib/fastlane/plugin/zeeva_discord/actions/zeeva_discord_action.rb', line 48 def self.description "Fastlane Plugin to Send Messages about Builds from Android, IOS Applications Via Fastlane" end |
.details ⇒ Object
60 61 62 63 |
# File 'lib/fastlane/plugin/zeeva_discord/actions/zeeva_discord_action.rb', line 60 def self.details # Optional: "Fastlane Plugin To Send Messages on Channels in Discord Private Server to Notify the Team once New Build Sent and You can Provide Custom Messages, Titles and Message Content With Json File Configuration and This Task Will be Started once you Push new Build from Your Mobile Application via Fastlane Task" end |
.get_message_body(buildName, buildType, platform, buildContent) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/fastlane/plugin/zeeva_discord/actions/zeeva_discord_action.rb', line 28 def self.(buildName, buildType, platform, buildContent) return "====== New Build ======" + "\n" + "Build Name : " + buildName + "\n" + "Build Type : " + buildType + "\n" + "Platform : " + platform + "\n" + "Build Content : " + buildContent + "\n" + "====== New Build ======" end |
.is_supported?(platform) ⇒ Boolean
112 113 114 115 |
# File 'lib/fastlane/plugin/zeeva_discord/actions/zeeva_discord_action.rb', line 112 def self.is_supported?(platform) [:ios, :mac, :android].include?(platform) true end |
.return_value ⇒ Object
56 57 58 |
# File 'lib/fastlane/plugin/zeeva_discord/actions/zeeva_discord_action.rb', line 56 def self.return_value # If your method provides a return value, you can describe here what it does end |
.run(params) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/fastlane/plugin/zeeva_discord/actions/zeeva_discord_action.rb', line 8 def self.run(params) serverToken = params[:server_token] applicationId = params[:client_id] channelId = params[:channel_id] buildName = params[:build_name] buildType = params[:build_type] platformCode = params[:platform_code] file_content = File.read('zeevaBuild.md'); buildContent = file_content UI.("Zeeva Fastlane Plugin - Discord Configuration - Started !!") UI.("=========================== Bot Credentials ===========================") UI.("Channel Id : " + channelId) UI.("Application Id : " + applicationId) UI.("Server Token : " + serverToken) UI.("=======================================================================") run_application_bot(serverToken, applicationId, channelId, (buildName, buildType, platformCode, buildContent)) end |
.run_application_bot(token, appId, channelId, messageBody) ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/fastlane/plugin/zeeva_discord/actions/zeeva_discord_action.rb', line 40 def self.run_application_bot(token, appId, channelId, ) bot = Discordrb::Bot.new token: token, client_id: appId bot.(channelId, ) # Enable this Line if you want to Stream the Connection # bot.run end |