NetCord
NetCord copied to clipboard
Context CancellationToken?
Description
Perhaps I have missed it on the documentation but do we have a way of accessing a cancellation token? Perhaps expires after 3 seconds or 15minutes if its deferred?
[SubSlashCommand("add", "Add timed role")]
public async Task OpenAddRoleModalAsync(CancellationToken cancellationToken) {}
Hi, something like this is not currently supported.
My takes on this:
- I am not a fan of introducing parameters for slash commands that are not mapped to actual slash command parameters (this feature could be handled by
Context.CancellationTokeninstead I think) - Making something like this to work would contradict https://github.com/NetCordDev/NetCord/issues/4#issuecomment-1454116536, you can always respond to the interaction with some other way making the cancellation token outdated
Even though I am not a fan of this feature, I am still curious what it would be for.