Add messages about war in Ukraine

This commit is contained in:
Oleksii Holub
2022-03-06 19:24:22 +02:00
parent 08d9af534b
commit b996215e36
6 changed files with 35 additions and 1 deletions

View File

@@ -166,4 +166,16 @@ public abstract class ExportCommandBase : TokenCommandBase
await ExecuteAsync(console, channels);
}
public override ValueTask ExecuteAsync(IConsole console)
{
// War in Ukraine message
console.Output.WriteLine("==================================================");
console.Output.WriteLine("⚠ UKRAINE IS AT WAR!");
console.Output.WriteLine("LEARN MORE & HELP: https://tyrrrz.me");
console.Output.WriteLine("==================================================");
console.Output.WriteLine("");
return default;
}
}

View File

@@ -15,6 +15,8 @@ public class ExportAllCommand : ExportCommandBase
public override async ValueTask ExecuteAsync(IConsole console)
{
await base.ExecuteAsync(console);
var cancellationToken = console.RegisterCancellationHandler();
var channels = new List<Channel>();

View File

@@ -15,6 +15,9 @@ public class ExportChannelsCommand : ExportCommandBase
[CommandOption("channel", 'c', IsRequired = true, Description = "Channel ID(s).")]
public IReadOnlyList<Snowflake> ChannelIds { get; init; } = Array.Empty<Snowflake>();
public override async ValueTask ExecuteAsync(IConsole console) =>
public override async ValueTask ExecuteAsync(IConsole console)
{
await base.ExecuteAsync(console);
await base.ExecuteAsync(console, ChannelIds);
}
}

View File

@@ -13,6 +13,8 @@ public class ExportDirectMessagesCommand : ExportCommandBase
{
public override async ValueTask ExecuteAsync(IConsole console)
{
await base.ExecuteAsync(console);
var cancellationToken = console.RegisterCancellationHandler();
await console.Output.WriteLineAsync("Fetching channels...");

View File

@@ -16,6 +16,8 @@ public class ExportGuildCommand : ExportCommandBase
public override async ValueTask ExecuteAsync(IConsole console)
{
await base.ExecuteAsync(console);
var cancellationToken = console.RegisterCancellationHandler();
await console.Output.WriteLineAsync("Fetching channels...");

View File

@@ -118,6 +118,19 @@ public class RootViewModel : Screen
App.SetLightTheme();
}
// War in Ukraine message
Notifications.Enqueue(
"⚠ UKRAINE IS AT WAR!",
"LEARN MORE & HELP", _ =>
{
ProcessEx.StartShellExecute("https://tyrrrz.me");
},
null,
true,
true,
TimeSpan.FromMinutes(1)
);
await CheckForUpdatesAsync();
}