API reference
Method UploadFileAsync
- Namespace
- DisCatSharp.Experimental.Entities
- Assembly
- DisCatSharp.Experimental.dll
UploadFileAsync(DiscordChannel, string, Stream, string?, CancellationToken)
Uploads a file to the channel for later use in a DiscordMessageBuilder.
public static Task<GcpAttachmentUploadInformation> UploadFileAsync(this DiscordChannel channel, string name, Stream stream, string? description = null, CancellationToken cancellationToken = default)
Parameters
channelDiscordChannelThe channel to upload the file to.
namestringThe name of the file to upload.
streamStreamThe stream of the file to upload.
descriptionstringThe description of the file to upload.
cancellationTokenCancellationTokenA token to cancel the request.
Returns
- Task<GcpAttachmentUploadInformation>
The upload information.