Aiko-IT-Systems / DisCatSharp

Your library to write discord apps in C# with focus on always providing access to the latest discord features
https://docs.dcs.aitsys.dev
Other
127 stars 40 forks source link

ClearComponents() sometimes produces an empty message #527

Open sentry-io[bot] opened 3 months ago

sentry-io[bot] commented 3 months ago

Sentry Issue: DISCATSHARP-297

DisCatSharp.Exceptions.BadRequestException: Bad request: BadRequest
  File "DiscordApiClient.cs", line 3254, in async Task<DiscordMessage> DiscordApiClient.EditMessageAsync(ulong channelId, ulong messageId, Optional<string> content, Optional<IEnumerable<DiscordEmbed>> embeds, Optional<IEnumerable<IMention>> mentions, IReadOnlyList<DiscordActionRowComponent> compo...
    var res = await this.DoRequestAsync(this.Discord, bucket, url, RestRequestMethod.PATCH, route, payload: DiscordJson.SerializeObject(pld)) {snip}
  File "DiscordMessage.cs", line 711, in async Task<DiscordMessage> DiscordMessage.ModifyAsync(Action<DiscordMessageBuilder> action)
    return await this.Discord.ApiClient.EditMessageAsync(this.ChannelId, this.Id, builder.Content, Optional.Some(builder.Embeds.AsEnumerable() {snip}
  File "Economy\Events\CollectEvent.cs", line 69, in async Task CollectEvent.Collect(DiscordClient cl, ComponentInteractionCreateEventArgs e)

System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread.