Made API models internal. Removed Discord.Net.API.
This commit is contained in:
16
src/Discord.Net.Rest/API/Rest/CreateChannelInviteParams.cs
Normal file
16
src/Discord.Net.Rest/API/Rest/CreateChannelInviteParams.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class CreateChannelInviteParams
|
||||
{
|
||||
[JsonProperty("max_age")]
|
||||
public Optional<int> MaxAge { get; set; }
|
||||
[JsonProperty("max_uses")]
|
||||
public Optional<int> MaxUses { get; set; }
|
||||
[JsonProperty("temporary")]
|
||||
public Optional<bool> IsTemporary { get; set; }
|
||||
}
|
||||
}
|
||||
17
src/Discord.Net.Rest/API/Rest/CreateDMChannelParams.cs
Normal file
17
src/Discord.Net.Rest/API/Rest/CreateDMChannelParams.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class CreateDMChannelParams
|
||||
{
|
||||
[JsonProperty("recipient_id")]
|
||||
public ulong RecipientId { get; }
|
||||
|
||||
public CreateDMChannelParams(ulong recipientId)
|
||||
{
|
||||
RecipientId = recipientId;
|
||||
}
|
||||
}
|
||||
}
|
||||
8
src/Discord.Net.Rest/API/Rest/CreateGuildBanParams.cs
Normal file
8
src/Discord.Net.Rest/API/Rest/CreateGuildBanParams.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
#pragma warning disable CS1591
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
internal class CreateGuildBanParams
|
||||
{
|
||||
public Optional<int> DeleteMessageDays { get; set; }
|
||||
}
|
||||
}
|
||||
23
src/Discord.Net.Rest/API/Rest/CreateGuildChannelParams.cs
Normal file
23
src/Discord.Net.Rest/API/Rest/CreateGuildChannelParams.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class CreateGuildChannelParams
|
||||
{
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; }
|
||||
[JsonProperty("type")]
|
||||
public ChannelType Type { get; }
|
||||
|
||||
[JsonProperty("bitrate")]
|
||||
public Optional<int> Bitrate { get; set; }
|
||||
|
||||
public CreateGuildChannelParams(string name, ChannelType type)
|
||||
{
|
||||
Name = name;
|
||||
Type = type;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class CreateGuildIntegrationParams
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public ulong Id { get; }
|
||||
[JsonProperty("type")]
|
||||
public string Type { get; }
|
||||
|
||||
public CreateGuildIntegrationParams(ulong id, string type)
|
||||
{
|
||||
Id = id;
|
||||
Type = type;
|
||||
}
|
||||
}
|
||||
}
|
||||
23
src/Discord.Net.Rest/API/Rest/CreateGuildParams.cs
Normal file
23
src/Discord.Net.Rest/API/Rest/CreateGuildParams.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class CreateGuildParams
|
||||
{
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; }
|
||||
[JsonProperty("region")]
|
||||
public string RegionId { get; }
|
||||
|
||||
[JsonProperty("icon")]
|
||||
public Optional<Image?> Icon { get; set; }
|
||||
|
||||
public CreateGuildParams(string name, string regionId)
|
||||
{
|
||||
Name = name;
|
||||
RegionId = regionId;
|
||||
}
|
||||
}
|
||||
}
|
||||
24
src/Discord.Net.Rest/API/Rest/CreateMessageParams.cs
Normal file
24
src/Discord.Net.Rest/API/Rest/CreateMessageParams.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class CreateMessageParams
|
||||
{
|
||||
[JsonProperty("content")]
|
||||
public string Content { get; }
|
||||
|
||||
[JsonProperty("nonce")]
|
||||
public Optional<string> Nonce { get; set; }
|
||||
[JsonProperty("tts")]
|
||||
public Optional<bool> IsTTS { get; set; }
|
||||
[JsonProperty("embed")]
|
||||
public Optional<Embed> Embed { get; set; }
|
||||
|
||||
public CreateMessageParams(string content)
|
||||
{
|
||||
Content = content;
|
||||
}
|
||||
}
|
||||
}
|
||||
17
src/Discord.Net.Rest/API/Rest/DeleteMessagesParams.cs
Normal file
17
src/Discord.Net.Rest/API/Rest/DeleteMessagesParams.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class DeleteMessagesParams
|
||||
{
|
||||
[JsonProperty("messages")]
|
||||
public ulong[] MessageIds { get; }
|
||||
|
||||
public DeleteMessagesParams(ulong[] messageIds)
|
||||
{
|
||||
MessageIds = messageIds;
|
||||
}
|
||||
}
|
||||
}
|
||||
13
src/Discord.Net.Rest/API/Rest/GetBotGatewayResponse.cs
Normal file
13
src/Discord.Net.Rest/API/Rest/GetBotGatewayResponse.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
internal class GetBotGatewayResponse
|
||||
{
|
||||
[JsonProperty("url")]
|
||||
public string Url { get; set; }
|
||||
[JsonProperty("shards")]
|
||||
public int Shards { get; set; }
|
||||
}
|
||||
}
|
||||
10
src/Discord.Net.Rest/API/Rest/GetChannelMessagesParams.cs
Normal file
10
src/Discord.Net.Rest/API/Rest/GetChannelMessagesParams.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma warning disable CS1591
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
internal class GetChannelMessagesParams
|
||||
{
|
||||
public Optional<int> Limit { get; set; }
|
||||
public Optional<Direction> RelativeDirection { get; set; }
|
||||
public Optional<ulong> RelativeMessageId { get; set; }
|
||||
}
|
||||
}
|
||||
11
src/Discord.Net.Rest/API/Rest/GetGatewayResponse.cs
Normal file
11
src/Discord.Net.Rest/API/Rest/GetGatewayResponse.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
internal class GetGatewayResponse
|
||||
{
|
||||
[JsonProperty("url")]
|
||||
public string Url { get; set; }
|
||||
}
|
||||
}
|
||||
9
src/Discord.Net.Rest/API/Rest/GetGuildMembersParams.cs
Normal file
9
src/Discord.Net.Rest/API/Rest/GetGuildMembersParams.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
#pragma warning disable CS1591
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
internal class GetGuildMembersParams
|
||||
{
|
||||
public Optional<int> Limit { get; set; }
|
||||
public Optional<ulong> AfterUserId { get; set; }
|
||||
}
|
||||
}
|
||||
11
src/Discord.Net.Rest/API/Rest/GetGuildPruneCountResponse.cs
Normal file
11
src/Discord.Net.Rest/API/Rest/GetGuildPruneCountResponse.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
internal class GetGuildPruneCountResponse
|
||||
{
|
||||
[JsonProperty("pruned")]
|
||||
public int Pruned { get; set; }
|
||||
}
|
||||
}
|
||||
8
src/Discord.Net.Rest/API/Rest/GetReactionUsersParams.cs
Normal file
8
src/Discord.Net.Rest/API/Rest/GetReactionUsersParams.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
internal class GetReactionUsersParams
|
||||
{
|
||||
public Optional<int> Limit { get; set; }
|
||||
public Optional<ulong> AfterUserId { get; set; }
|
||||
}
|
||||
}
|
||||
17
src/Discord.Net.Rest/API/Rest/GuildPruneParams.cs
Normal file
17
src/Discord.Net.Rest/API/Rest/GuildPruneParams.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class GuildPruneParams
|
||||
{
|
||||
[JsonProperty("days")]
|
||||
public int Days { get; }
|
||||
|
||||
public GuildPruneParams(int days)
|
||||
{
|
||||
Days = days;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class ModifyChannelPermissionsParams
|
||||
{
|
||||
[JsonProperty("type")]
|
||||
public string Type { get; }
|
||||
[JsonProperty("allow")]
|
||||
public ulong Allow { get; }
|
||||
[JsonProperty("deny")]
|
||||
public ulong Deny { get; }
|
||||
|
||||
public ModifyChannelPermissionsParams(string type, ulong allow, ulong deny)
|
||||
{
|
||||
Type = type;
|
||||
Allow = allow;
|
||||
Deny = deny;
|
||||
}
|
||||
}
|
||||
}
|
||||
17
src/Discord.Net.Rest/API/Rest/ModifyCurrentUserNickParams.cs
Normal file
17
src/Discord.Net.Rest/API/Rest/ModifyCurrentUserNickParams.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class ModifyCurrentUserNickParams
|
||||
{
|
||||
[JsonProperty("nick")]
|
||||
public string Nickname { get; }
|
||||
|
||||
public ModifyCurrentUserNickParams(string nickname)
|
||||
{
|
||||
Nickname = nickname;
|
||||
}
|
||||
}
|
||||
}
|
||||
14
src/Discord.Net.Rest/API/Rest/ModifyCurrentUserParams.cs
Normal file
14
src/Discord.Net.Rest/API/Rest/ModifyCurrentUserParams.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class ModifyCurrentUserParams
|
||||
{
|
||||
[JsonProperty("username")]
|
||||
public Optional<string> Username { get; set; }
|
||||
[JsonProperty("avatar")]
|
||||
public Optional<Image?> Avatar { get; set; }
|
||||
}
|
||||
}
|
||||
14
src/Discord.Net.Rest/API/Rest/ModifyGuildChannelParams.cs
Normal file
14
src/Discord.Net.Rest/API/Rest/ModifyGuildChannelParams.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class ModifyGuildChannelParams
|
||||
{
|
||||
[JsonProperty("name")]
|
||||
public Optional<string> Name { get; set; }
|
||||
[JsonProperty("position")]
|
||||
public Optional<int> Position { get; set; }
|
||||
}
|
||||
}
|
||||
20
src/Discord.Net.Rest/API/Rest/ModifyGuildChannelsParams.cs
Normal file
20
src/Discord.Net.Rest/API/Rest/ModifyGuildChannelsParams.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class ModifyGuildChannelsParams
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public ulong Id { get; set; }
|
||||
[JsonProperty("position")]
|
||||
public int Position { get; set; }
|
||||
|
||||
public ModifyGuildChannelsParams(ulong id, int position)
|
||||
{
|
||||
Id = id;
|
||||
Position = position;
|
||||
}
|
||||
}
|
||||
}
|
||||
14
src/Discord.Net.Rest/API/Rest/ModifyGuildEmbedParams.cs
Normal file
14
src/Discord.Net.Rest/API/Rest/ModifyGuildEmbedParams.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class ModifyGuildEmbedParams
|
||||
{
|
||||
[JsonProperty("enabled")]
|
||||
public Optional<bool> Enabled { get; set; }
|
||||
[JsonProperty("channel")]
|
||||
public Optional<ulong?> ChannelId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class ModifyGuildIntegrationParams
|
||||
{
|
||||
[JsonProperty("expire_behavior")]
|
||||
public Optional<int> ExpireBehavior { get; set; }
|
||||
[JsonProperty("expire_grace_period")]
|
||||
public Optional<int> ExpireGracePeriod { get; set; }
|
||||
[JsonProperty("enable_emoticons")]
|
||||
public Optional<bool> EnableEmoticons { get; set; }
|
||||
}
|
||||
}
|
||||
20
src/Discord.Net.Rest/API/Rest/ModifyGuildMemberParams.cs
Normal file
20
src/Discord.Net.Rest/API/Rest/ModifyGuildMemberParams.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class ModifyGuildMemberParams
|
||||
{
|
||||
[JsonProperty("mute")]
|
||||
public Optional<bool> Mute { get; set; }
|
||||
[JsonProperty("deaf")]
|
||||
public Optional<bool> Deaf { get; set; }
|
||||
[JsonProperty("nick")]
|
||||
public Optional<string> Nickname { get; set; }
|
||||
[JsonProperty("roles")]
|
||||
public Optional<ulong[]> RoleIds { get; set; }
|
||||
[JsonProperty("channel_id")]
|
||||
public Optional<ulong> ChannelId { get; set; }
|
||||
}
|
||||
}
|
||||
30
src/Discord.Net.Rest/API/Rest/ModifyGuildParams.cs
Normal file
30
src/Discord.Net.Rest/API/Rest/ModifyGuildParams.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class ModifyGuildParams
|
||||
{
|
||||
[JsonProperty("username")]
|
||||
public Optional<string> Username { get; set; }
|
||||
[JsonProperty("name")]
|
||||
public Optional<string> Name { get; set; }
|
||||
[JsonProperty("region")]
|
||||
public Optional<string> RegionId { get; set; }
|
||||
[JsonProperty("verification_level")]
|
||||
public Optional<VerificationLevel> VerificationLevel { get; set; }
|
||||
[JsonProperty("default_message_notifications")]
|
||||
public Optional<DefaultMessageNotifications> DefaultMessageNotifications { get; set; }
|
||||
[JsonProperty("afk_timeout")]
|
||||
public Optional<int> AfkTimeout { get; set; }
|
||||
[JsonProperty("icon")]
|
||||
public Optional<Image?> Icon { get; set; }
|
||||
[JsonProperty("splash")]
|
||||
public Optional<Image?> Splash { get; set; }
|
||||
[JsonProperty("afk_channel_id")]
|
||||
public Optional<ulong?> AfkChannelId { get; set; }
|
||||
[JsonProperty("owner_id")]
|
||||
public Optional<ulong> OwnerId { get; set; }
|
||||
}
|
||||
}
|
||||
22
src/Discord.Net.Rest/API/Rest/ModifyGuildRoleParams.cs
Normal file
22
src/Discord.Net.Rest/API/Rest/ModifyGuildRoleParams.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class ModifyGuildRoleParams
|
||||
{
|
||||
[JsonProperty("name")]
|
||||
public Optional<string> Name { get; set; }
|
||||
[JsonProperty("permissions")]
|
||||
public Optional<ulong> Permissions { get; set; }
|
||||
[JsonProperty("position")]
|
||||
public Optional<int> Position { get; set; }
|
||||
[JsonProperty("color")]
|
||||
public Optional<uint> Color { get; set; }
|
||||
[JsonProperty("hoist")]
|
||||
public Optional<bool> Hoist { get; set; }
|
||||
[JsonProperty("mentionable")]
|
||||
public Optional<bool> Mentionable { get; set; }
|
||||
}
|
||||
}
|
||||
17
src/Discord.Net.Rest/API/Rest/ModifyGuildRolesParams.cs
Normal file
17
src/Discord.Net.Rest/API/Rest/ModifyGuildRolesParams.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class ModifyGuildRolesParams : ModifyGuildRoleParams
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public ulong Id { get; }
|
||||
|
||||
public ModifyGuildRolesParams(ulong id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
}
|
||||
}
|
||||
14
src/Discord.Net.Rest/API/Rest/ModifyMessageParams.cs
Normal file
14
src/Discord.Net.Rest/API/Rest/ModifyMessageParams.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class ModifyMessageParams
|
||||
{
|
||||
[JsonProperty("content")]
|
||||
public Optional<string> Content { get; set; }
|
||||
[JsonProperty("embed")]
|
||||
public Optional<Embed> Embed { get; set; }
|
||||
}
|
||||
}
|
||||
12
src/Discord.Net.Rest/API/Rest/ModifyTextChannelParams.cs
Normal file
12
src/Discord.Net.Rest/API/Rest/ModifyTextChannelParams.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class ModifyTextChannelParams : ModifyGuildChannelParams
|
||||
{
|
||||
[JsonProperty("topic")]
|
||||
public Optional<string> Topic { get; set; }
|
||||
}
|
||||
}
|
||||
14
src/Discord.Net.Rest/API/Rest/ModifyVoiceChannelParams.cs
Normal file
14
src/Discord.Net.Rest/API/Rest/ModifyVoiceChannelParams.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
#pragma warning disable CS1591
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
|
||||
internal class ModifyVoiceChannelParams : ModifyGuildChannelParams
|
||||
{
|
||||
[JsonProperty("bitrate")]
|
||||
public Optional<int> Bitrate { get; set; }
|
||||
[JsonProperty("user_limit")]
|
||||
public Optional<int> UserLimit { get; set; }
|
||||
}
|
||||
}
|
||||
35
src/Discord.Net.Rest/API/Rest/UploadFileParams.cs
Normal file
35
src/Discord.Net.Rest/API/Rest/UploadFileParams.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
#pragma warning disable CS1591
|
||||
using Discord.Net.Rest;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace Discord.API.Rest
|
||||
{
|
||||
internal class UploadFileParams
|
||||
{
|
||||
public Stream File { get; }
|
||||
|
||||
public Optional<string> Filename { get; set; }
|
||||
public Optional<string> Content { get; set; }
|
||||
public Optional<string> Nonce { get; set; }
|
||||
public Optional<bool> IsTTS { get; set; }
|
||||
|
||||
public UploadFileParams(Stream file)
|
||||
{
|
||||
File = file;
|
||||
}
|
||||
|
||||
public IReadOnlyDictionary<string, object> ToDictionary()
|
||||
{
|
||||
var d = new Dictionary<string, object>();
|
||||
d["file"] = new MultipartFile(File, Filename.GetValueOrDefault("unknown.dat"));
|
||||
if (Content.IsSpecified)
|
||||
d["content"] = Content.Value;
|
||||
if (IsTTS.IsSpecified)
|
||||
d["tts"] = IsTTS.Value.ToString();
|
||||
if (Nonce.IsSpecified)
|
||||
d["nonce"] = Nonce.Value;
|
||||
return d;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user