[Bug]: Can't edit ephemeral messages
FemLolStudio opened this issue · 6 comments
Check The Docs
- I double checked the docs and couldn't find any useful information.
Verify Issue Source
- I verified the issue was caused by Discord.Net.
Check your intents
- I double checked that I have the required intents.
Description
I have some command in my bot where I used this method to inform the user about the current stage from the process, but today I noticed somewhy now it's not working.
Maybe something changed about the Discord API, because I get the same problem on the previous Discord.NET versions.
The problem exists in 3.9.0 too, that was the lowest what I was able to go with my current bot codes, so maybe it's something about the Discord API.
Version
3.13.0
Logs
guid:4c60 : 07:34:48 Command Command: ephemeral-test, User: femlol
guid:e291 : 07:34:49 App Command Discord.Net.HttpException: The server responded with error 10008: Unknown Message
at Discord.Net.Queue.RequestBucket.SendAsync(RestRequest request)
at Discord.Net.Queue.RequestQueue.SendAsync(RestRequest request)
at Discord.API.DiscordRestApiClient.SendInternalAsync(String method, String endpoint, RestRequest request)
at Discord.API.DiscordRestApiClient.SendJsonAsync[TResponse](String method, String endpoint, Object payload, BucketId bucketId, ClientBucketType clientBucket, RequestOptions options)
at Discord.Rest.RestUserMessage.ModifyAsync(Action`1 func, RequestOptions options)
at ChibiMation.Command.BaseCommands.Test(Boolean ephemeral) in /src/Command/BaseCommands.cs:line 68
at Discord.Interactions.Builders.ModuleClassBuilder.<>c__DisplayClass11_0.<<CreateCallback>g__ExecuteCallback|1>d.MoveNext()
guid:4c60 : 07:34:57 Command Command: ephemeral-test, User: femlol
Sample
[SlashCommand("ephemeral-test", "Testing bug")]
public async Task Test(bool ephemeral)
{
await DeferAsync(ephemeral: ephemeral);
IUserMessage msg = await FollowupAsync("Test", ephemeral: ephemeral);
await msg.ModifyAsync(x => x.Content = "Test success");
}
Packages
<ItemGroup>
<PackageReference Include="AWSSDK.Extensions.NETCore.Setup" Version="3.7.300" />
<PackageReference Include="AWSSDK.S3" Version="3.7.305.14" />
<PackageReference Include="Betalgo.OpenAI" Version="7.4.3" />
<PackageReference Include="Discord.Net" Version="3.13.0" />
<PackageReference Include="Google.Apis.YouTube.v3" Version="1.66.0.3205" />
<PackageReference Include="InnerTube" Version="1.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration.Yaml" Version="2.0.0-preview2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.AzureAppServices" Version="8.0.1" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.6" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.0-beta.2" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.2" />
<PackageReference Include="YamlDotNet" Version="13.7.1" />
</ItemGroup>
Environment
- OS: Ubuntu 20.04.6 LTS
- Architecture: x64 (vps)
- .Net: 8.0
iirc FollowupAsync
returns a RestFollowupMessage
. So try using this type instead.
Hmm, okey. Yeah now its working. But it's actually returning an IUserMessage
instead of RestFollowupMessage
so thats confusing.
Now in this form it's working:
[SlashCommand("ephemeral-test", "Testing bug")]
public async Task Test(bool ephemeral)
{
await DeferAsync(ephemeral: ephemeral);
RestFollowupMessage msg = (RestFollowupMessage)await FollowupAsync("Test", ephemeral: ephemeral);
await msg.ModifyAsync(x => x.Content = "Test success");
}
But it's actually returning an
IUserMessage
instead ofRestFollowupMessage
so thats confusing.
Hmm yeah, that's because of an abstraction layer. Actual method impls in Rest/SocketInteraction
return a RestFollowupMessage
. I'll see if we can change this.
How could you first not respond with a file and then afterwards modifying it with a uploading a file to the message?
How could you first not respond with a file and then afterwards modifying it with a uploading a file to the message?
How could you not ask for support in the discord
Okay sorry