[Feature] Add Message property and UpdateAsync() to IModalInteraction (#2645)

* initial commit

* better (?) comments

* whoops, accidentally commited this
This commit is contained in:
Misha133
2023-03-31 14:15:19 +03:00
committed by GitHub
parent bdd755b8cf
commit 83dfa0cea5
5 changed files with 150 additions and 7 deletions

View File

@@ -1,3 +1,6 @@
using System;
using System.Threading.Tasks;
namespace Discord
{
/// <summary>
@@ -9,5 +12,24 @@ namespace Discord
/// Gets the data received with this interaction; contains the clicked button.
/// </summary>
new IModalInteractionData Data { get; }
/// <summary>
/// Gets the message the modal originates from.
/// </summary>
/// <remarks>
/// This property is only populated if the modal was created from a message component.
/// </remarks>
IUserMessage Message { get; }
/// <summary>
/// Updates the message which this modal originates from with the type <see cref="InteractionResponseType.UpdateMessage"/>
/// </summary>
/// <param name="func">A delegate containing the properties to modify the message with.</param>
/// <param name="options">The options to be used when sending the request.</param>
/// <returns>A task that represents the asynchronous operation of updating the message.</returns>
/// <remarks>
/// This method can be used only if the modal was created from a message component.
/// </remarks>
Task UpdateAsync(Action<MessageProperties> func, RequestOptions options = null);
}
}