Skip to content

Commit 705502c

Browse files
committed
defer bot log command
1 parent a736f06 commit 705502c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

CompatBot/Commands/Bot.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ public static async ValueTask Log(
2929
[Description("Specific date (e.g. 2020-01-31)")]string date = ""
3030
)
3131
{
32+
var ephemeral = !ctx.Channel.IsPrivate;
33+
await ctx.DeferResponseAsync(ephemeral).ConfigureAwait(false);
3234
try
3335
{
3436
LogManager.LogFactory.Flush();
@@ -63,12 +65,12 @@ public static async ValueTask Log(
6365
await ctx.RespondAsync(response).ConfigureAwait(false);
6466
}
6567
else
66-
await ctx.RespondAsync($"{Config.Reactions.Failure} Compressed log size is too large, ask <@98072022709456896> for help :(", ephemeral: true).ConfigureAwait(false);
68+
await ctx.RespondAsync($"{Config.Reactions.Failure} Compressed log size is too large, ask <@98072022709456896> for help :(", ephemeral: ephemeral).ConfigureAwait(false);
6769
}
6870
catch (Exception e)
6971
{
7072
Config.Log.Warn(e, "Failed to upload current log");
71-
await ctx.RespondAsync($"{Config.Reactions.Failure} Failed to send the log: {e.Message}".Trim(EmbedPager.MaxMessageLength), true).ConfigureAwait(false);
73+
await ctx.RespondAsync($"{Config.Reactions.Failure} Failed to send the log: {e.Message}".Trim(EmbedPager.MaxMessageLength), ephemeral).ConfigureAwait(false);
7274
}
7375
}
7476

0 commit comments

Comments
 (0)