mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-02-14 15:53:30 -07:00
Add messages about war in Ukraine
This commit is contained in:
parent
08d9af534b
commit
b996215e36
|
|
@ -166,4 +166,16 @@ public abstract class ExportCommandBase : TokenCommandBase
|
||||||
|
|
||||||
await ExecuteAsync(console, channels);
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -15,6 +15,8 @@ public class ExportAllCommand : ExportCommandBase
|
||||||
|
|
||||||
public override async ValueTask ExecuteAsync(IConsole console)
|
public override async ValueTask ExecuteAsync(IConsole console)
|
||||||
{
|
{
|
||||||
|
await base.ExecuteAsync(console);
|
||||||
|
|
||||||
var cancellationToken = console.RegisterCancellationHandler();
|
var cancellationToken = console.RegisterCancellationHandler();
|
||||||
var channels = new List<Channel>();
|
var channels = new List<Channel>();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,9 @@ public class ExportChannelsCommand : ExportCommandBase
|
||||||
[CommandOption("channel", 'c', IsRequired = true, Description = "Channel ID(s).")]
|
[CommandOption("channel", 'c', IsRequired = true, Description = "Channel ID(s).")]
|
||||||
public IReadOnlyList<Snowflake> ChannelIds { get; init; } = Array.Empty<Snowflake>();
|
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);
|
await base.ExecuteAsync(console, ChannelIds);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -13,6 +13,8 @@ public class ExportDirectMessagesCommand : ExportCommandBase
|
||||||
{
|
{
|
||||||
public override async ValueTask ExecuteAsync(IConsole console)
|
public override async ValueTask ExecuteAsync(IConsole console)
|
||||||
{
|
{
|
||||||
|
await base.ExecuteAsync(console);
|
||||||
|
|
||||||
var cancellationToken = console.RegisterCancellationHandler();
|
var cancellationToken = console.RegisterCancellationHandler();
|
||||||
|
|
||||||
await console.Output.WriteLineAsync("Fetching channels...");
|
await console.Output.WriteLineAsync("Fetching channels...");
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,8 @@ public class ExportGuildCommand : ExportCommandBase
|
||||||
|
|
||||||
public override async ValueTask ExecuteAsync(IConsole console)
|
public override async ValueTask ExecuteAsync(IConsole console)
|
||||||
{
|
{
|
||||||
|
await base.ExecuteAsync(console);
|
||||||
|
|
||||||
var cancellationToken = console.RegisterCancellationHandler();
|
var cancellationToken = console.RegisterCancellationHandler();
|
||||||
|
|
||||||
await console.Output.WriteLineAsync("Fetching channels...");
|
await console.Output.WriteLineAsync("Fetching channels...");
|
||||||
|
|
|
||||||
|
|
@ -118,6 +118,19 @@ public class RootViewModel : Screen
|
||||||
App.SetLightTheme();
|
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();
|
await CheckForUpdatesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue