fix: remove unnecessary async methods, fix PluralkitApiService
This commit is contained in:
parent
086eb95452
commit
db01f879bd
10 changed files with 96 additions and 73 deletions
|
|
@ -61,7 +61,7 @@ public class GuildCreateResponder(
|
|||
_logger.Information("Joined new guild {GuildName} / {GuildId}", guildName, guildId);
|
||||
|
||||
if (config.Discord.GuildLogId != null && evt.Guild.IsT0)
|
||||
await webhookExecutor.QueueLogAsync(config.Discord.GuildLogId.Value, new EmbedBuilder()
|
||||
webhookExecutor.QueueLog(config.Discord.GuildLogId.Value, new EmbedBuilder()
|
||||
.WithTitle("Joined new guild")
|
||||
.WithDescription($"Joined new guild **{guild.Name}**")
|
||||
.WithFooter($"ID: {guild.ID}")
|
||||
|
|
@ -75,24 +75,24 @@ public class GuildCreateResponder(
|
|||
return Result.Success;
|
||||
}
|
||||
|
||||
public async Task<Result> RespondAsync(IGuildDelete evt, CancellationToken ct = default)
|
||||
public Task<Result> RespondAsync(IGuildDelete evt, CancellationToken ct = default)
|
||||
{
|
||||
if (evt.IsUnavailable.OrDefault(false))
|
||||
{
|
||||
_logger.Debug("Guild {GuildId} became unavailable", evt.ID);
|
||||
return Result.Success;
|
||||
return Task.FromResult(Result.Success);
|
||||
}
|
||||
|
||||
if (!guildCache.TryGet(evt.ID, out var guild))
|
||||
{
|
||||
_logger.Information("Left uncached guild {GuildId}", evt.ID);
|
||||
return Result.Success;
|
||||
return Task.FromResult(Result.Success);
|
||||
}
|
||||
|
||||
_logger.Information("Left guild {GuildName} / {GuildId}", guild.Name, guild.ID);
|
||||
|
||||
if (config.Discord.GuildLogId != null)
|
||||
await webhookExecutor.QueueLogAsync(config.Discord.GuildLogId.Value, new EmbedBuilder()
|
||||
webhookExecutor.QueueLog(config.Discord.GuildLogId.Value, new EmbedBuilder()
|
||||
.WithTitle("Left guild")
|
||||
.WithDescription($"Left guild **{guild.Name}**")
|
||||
.WithFooter($"ID: {guild.ID}")
|
||||
|
|
@ -103,6 +103,6 @@ public class GuildCreateResponder(
|
|||
.Build()
|
||||
.GetOrThrow());
|
||||
|
||||
return Result.Success;
|
||||
return Task.FromResult(Result.Success);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue