Skip to main content

Chats & Social Media

As a final step of your build automation process, you may want to report errors or announce a new version through different chats and social media channels. Fallout comes with basic support for the most common platforms.

You can send a Slack messages as follows:

// using static Fallout.Common.Tools.Slack.SlackTasks;

[Parameter] [Secret] readonly string SlackWebhook;

Target Send => _ => _
.Executes(async () =>
{
await SendSlackMessageAsync(_ => _
.SetText("Hello from Fallout!"),
SlackWebhook);
});
note

For more advanced scenarios, check out the SlackAPI or SlackNet project.

You can send a Microsoft Teams messages as follows:

// using static Fallout.Common.Tools.Teams.TeamsTasks;

[Parameter] [Secret] readonly string TeamsWebhook;

Target Send => _ => _
.Executes(async () =>
{
await SendTeamsMessageAsync(_ => _
.SetText("Hello from Fallout!"),
TeamsWebhook)
});

You can send a Twitter messages as follows:

// using static Fallout.Common.Tools.Twitter.TwitterTasks;

[Parameter] [Secret] readonly string TwitterConsumerKey;
[Parameter] [Secret] readonly string TwitterConsumerSecret;
[Parameter] [Secret] readonly string TwitterAccessToken;
[Parameter] [Secret] readonly string TwitterAccessTokenSecret;

Target Send => _ => _
.Executes(async () =>
{
await SendTweetAsync(
message: "Hello from Fallout",
TwitterConsumerKey,
TwitterConsumerSecret,
TwitterAccessToken,
TwitterAccessTokenSecret);
});
note

For more advanced scenarios, check out the Tweetinvi project.

You can send a Gitter messages as follows:

// using static Fallout.Common.Tools.Gitter.GitterTasks;

[Parameter] readonly string GitterRoomId;
[Parameter] [Secret] readonly string GitterAuthToken;

Target Send => _ => _
.Executes(() =>
{
SendGitterMessage(
message: "Hello from Fallout",
GitterRoomId,
GitterAuthToken);
});
note

For more advanced scenarios, check out the gitter-api-pcl project.