discord_notifier plugin
Getting Started
This project is a fastlane plugin. To get started with fastlane-plugin-discord_notifier
, add it to your project by running:
fastlane add_plugin discord_notifier
About discord_notifier
Discord Notifier
discord_notifier
posts a message in a discord channel defined by a webhook created for your discord server.
Usage
To get started, first, create a webhook in your Discord server. You can find detailed instructions here. You will need the webhook url in each call to successfully post a message in your channel.
discord_notifier(
webhook_url:"<discord webhook url>",
title: "<a title>",
description: "<a description>",
fields:[
{
name:"<some name>",
value:"<some value>"
},
{
name:"<some name>",
value:"<some value>"
inline: true
},
{
name:"<some name>",
value:"<some value>"
inline: true
}
]
)
Keys
Key | Description | Optional |
---|---|---|
webhook_url | Discord webhook url | false |
title | Message title | false |
description | Message description | false |
thumbnail_url | Thumbnail url | true |
image_url | Message image url | true |
success | Setting to true will turn the message sidebar green whereas false will turn it to red. If color is set, it will override the default behaviour of success
|
true |
color | The color defined will be attributed to the message sidebar. The sidebar by default uses #4BB543 if success is set to true and #CC0000 if set to false. If color is set, it overrides the default color described before. |
true |
gravatar_email | If set, then the author's image will be replaced by the resolved gravatar. If not and the next 3 keys are set, the author's image will be set as the user's discord avatar | true |
bot_token | Token of bot assigned to discord server | true |
client_id | Client id retrieved upon bot creation | true |
discord_user_id | User id of the discord user. Setting it as an env variable is suggested so that different users use their own id | true |
fields | Array of extra name , value pairs to add to a message. Setting inline to true will combine fields in the same row |
true |
Note on the Bot: Currently the bot is needed in case you want to retrieve your discord user's data. the plugin is using the user's name and avatar to assign them to the author of the message. Create a discord application, then a new bot and finally assign it to your server. You will need the bot token, the client id and your discord user's id to successfully retrieve all the necessary data.
Example
Check out the example Fastfile
to see how to use this plugin. Try it by cloning the repo, running fastlane install_plugins
and bundle exec fastlane test
. You can also use a visualizer to see how discord formats your messages using all the aforementioned keys.
Run tests for this plugin
To run both the tests, and code style validation, run
rake
To automatically fix many of the styling issues, use
rubocop -a
Issues and Feedback
For any other issues and feedback about this plugin, please submit it to this repository.
Troubleshooting
If you have trouble using plugins, check out the Plugins Troubleshooting guide.
Using fastlane Plugins
For more information about how the fastlane
plugin system works, check out the Plugins documentation.
About fastlane
fastlane is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out fastlane.tools.