Browse Source

Updated UploadFile REST Model

tags/1.0-rc
RogueException 9 years ago
parent
commit
069bc2b931
3 changed files with 6 additions and 6 deletions
  1. +4
    -4
      src/Discord.Net/API/Rest/UploadFile.cs
  2. +1
    -1
      src/Discord.Net/Discord.Net.Net45.csproj
  3. +1
    -1
      src/Discord.Net/Entities/Helpers/MessageManager.cs

src/Discord.Net/API/Rest/Unconfirmed/SendFile.cs → src/Discord.Net/API/Rest/UploadFile.cs View File

@@ -5,7 +5,7 @@ using System.IO;


namespace Discord.API.Rest namespace Discord.API.Rest
{ {
public class SendFileRequest : IRestFileRequest<Message>
public class UploadFileRequest : IRestFileRequest<Message>
{ {
string IRestRequest.Method => "POST"; string IRestRequest.Method => "POST";
string IRestRequest.Endpoint => $"channels/{ChannelId}/messages"; string IRestRequest.Endpoint => $"channels/{ChannelId}/messages";
@@ -21,13 +21,13 @@ namespace Discord.API.Rest


public ulong ChannelId { get; } public ulong ChannelId { get; }


public string Filename { get; set; }
public Stream Stream { get; set; }
public string Content { get; set; } public string Content { get; set; }
public string Nonce { get; set; } public string Nonce { get; set; }
public bool IsTTS { get; set; } public bool IsTTS { get; set; }
public Stream Stream { get; set; }
public string Filename { get; set; }


public SendFileRequest(ulong channelId)
public UploadFileRequest(ulong channelId)
{ {
ChannelId = channelId; ChannelId = channelId;
} }

+ 1
- 1
src/Discord.Net/Discord.Net.Net45.csproj View File

@@ -169,7 +169,7 @@
<Compile Include="API\Rest\RemoveGuildMember.cs" /> <Compile Include="API\Rest\RemoveGuildMember.cs" />
<Compile Include="API\Rest\SyncGuildIntegration.cs" /> <Compile Include="API\Rest\SyncGuildIntegration.cs" />
<Compile Include="API\Rest\TriggerTypingIndicator.cs" /> <Compile Include="API\Rest\TriggerTypingIndicator.cs" />
<Compile Include="API\Rest\Unconfirmed\SendFile.cs" />
<Compile Include="API\Rest\UploadFile.cs" />
<Compile Include="API\VoiceSocket\OpCode.cs" /> <Compile Include="API\VoiceSocket\OpCode.cs" />
<Compile Include="API\VoiceSocket\Unconfirmed\Commands\Heartbeat.cs" /> <Compile Include="API\VoiceSocket\Unconfirmed\Commands\Heartbeat.cs" />
<Compile Include="API\VoiceSocket\Unconfirmed\Commands\Identify.cs" /> <Compile Include="API\VoiceSocket\Unconfirmed\Commands\Identify.cs" />


+ 1
- 1
src/Discord.Net/Entities/Helpers/MessageManager.cs View File

@@ -157,7 +157,7 @@ namespace Discord
} }
public async Task<Message> SendFile(Stream stream, string filename, string text = null, bool isTTS = false) public async Task<Message> SendFile(Stream stream, string filename, string text = null, bool isTTS = false)
{ {
var request = new SendFileRequest(_channel.Id)
var request = new UploadFileRequest(_channel.Id)
{ {
Filename = filename, Filename = filename,
Stream = stream Stream = stream


Loading…
Cancel
Save