@@ -6,7 +6,7 @@ namespace Discord.API.Rest | |||||
public class CreateDMChannelParams | public class CreateDMChannelParams | ||||
{ | { | ||||
[JsonProperty("recipient_id")] | [JsonProperty("recipient_id")] | ||||
internal ulong _recipientId; | |||||
internal ulong _recipientId { get; set; } | |||||
public ulong RecipientId { set { _recipientId = value; } } | public ulong RecipientId { set { _recipientId = value; } } | ||||
public IUser Recipient { set { _recipientId = value.Id; } } | public IUser Recipient { set { _recipientId = value.Id; } } | ||||
} | } | ||||
@@ -6,7 +6,7 @@ namespace Discord.API.Rest | |||||
public class CreateGuildBanParams | public class CreateGuildBanParams | ||||
{ | { | ||||
[JsonProperty("delete-message-days")] | [JsonProperty("delete-message-days")] | ||||
internal Optional<int> _deleteMessageDays; | |||||
internal Optional<int> _deleteMessageDays { get; set; } | |||||
public int DeleteMessageDays { set { _deleteMessageDays = value; } } | public int DeleteMessageDays { set { _deleteMessageDays = value; } } | ||||
} | } | ||||
} | } |
@@ -6,15 +6,15 @@ namespace Discord.API.Rest | |||||
public class CreateGuildChannelParams | public class CreateGuildChannelParams | ||||
{ | { | ||||
[JsonProperty("name")] | [JsonProperty("name")] | ||||
internal string _name; | |||||
internal string _name { get; set; } | |||||
public string Name { set { _name = value; } } | public string Name { set { _name = value; } } | ||||
[JsonProperty("type")] | [JsonProperty("type")] | ||||
internal ChannelType _type; | |||||
internal ChannelType _type { get; set; } | |||||
public ChannelType Type { set { _type = value; } } | public ChannelType Type { set { _type = value; } } | ||||
[JsonProperty("bitrate")] | [JsonProperty("bitrate")] | ||||
internal Optional<int> _bitrate; | |||||
internal Optional<int> _bitrate { get; set; } | |||||
public int Bitrate { set { _bitrate = value; } } | public int Bitrate { set { _bitrate = value; } } | ||||
} | } | ||||
} | } |
@@ -13,7 +13,7 @@ namespace Discord.API.Rest | |||||
public string Region { internal get; set; } | public string Region { internal get; set; } | ||||
[JsonProperty("icon")] | [JsonProperty("icon")] | ||||
internal Optional<Image?> _icon; | |||||
internal Optional<Image?> _icon { get; set; } | |||||
public Stream Icon { set { _icon = value != null ? new Image(value) : (Image?)null; } } | public Stream Icon { set { _icon = value != null ? new Image(value) : (Image?)null; } } | ||||
} | } | ||||
} | } |
@@ -6,15 +6,15 @@ namespace Discord.API.Rest | |||||
public class CreateMessageParams | public class CreateMessageParams | ||||
{ | { | ||||
[JsonProperty("content")] | [JsonProperty("content")] | ||||
internal string _content; | |||||
internal string _content { get; set; } | |||||
public string Content { set { _content = value; } } | public string Content { set { _content = value; } } | ||||
[JsonProperty("nonce")] | [JsonProperty("nonce")] | ||||
internal Optional<string> _nonce; | |||||
internal Optional<string> _nonce { get; set; } | |||||
public string Nonce { set { _nonce = value; } } | public string Nonce { set { _nonce = value; } } | ||||
[JsonProperty("tts")] | [JsonProperty("tts")] | ||||
internal Optional<bool> _tts; | |||||
internal Optional<bool> _tts { get; set; } | |||||
public bool IsTTS { set { _tts = value; } } | public bool IsTTS { set { _tts = value; } } | ||||
} | } | ||||
} | } |
@@ -8,7 +8,7 @@ namespace Discord.API.Rest | |||||
public class DeleteMessagesParams | public class DeleteMessagesParams | ||||
{ | { | ||||
[JsonProperty("messages")] | [JsonProperty("messages")] | ||||
internal ulong[] _messages; | |||||
internal ulong[] _messages { get; set; } | |||||
public IEnumerable<ulong> MessageIds { set { _messages = value.ToArray(); } } | public IEnumerable<ulong> MessageIds { set { _messages = value.ToArray(); } } | ||||
public IEnumerable<IMessage> Messages { set { _messages = value.Select(x => x.Id).ToArray(); } } | public IEnumerable<IMessage> Messages { set { _messages = value.Select(x => x.Id).ToArray(); } } | ||||
} | } | ||||
@@ -6,7 +6,7 @@ | |||||
public Direction RelativeDirection { internal get; set; } = Direction.Before; | public Direction RelativeDirection { internal get; set; } = Direction.Before; | ||||
internal Optional<ulong> _relativeMessageId; | |||||
internal Optional<ulong> _relativeMessageId { get; set; } | |||||
public ulong RelativeMessageId { set { _relativeMessageId = value; } } | public ulong RelativeMessageId { set { _relativeMessageId = value; } } | ||||
public IMessage RelativeMessage { set { _relativeMessageId = value.Id; } } | public IMessage RelativeMessage { set { _relativeMessageId = value.Id; } } | ||||
} | } | ||||
@@ -2,10 +2,10 @@ | |||||
{ | { | ||||
public class GetGuildMembersParams | public class GetGuildMembersParams | ||||
{ | { | ||||
internal Optional<int> _limit; | |||||
internal Optional<int> _limit { get; set; } | |||||
public int Limit { set { _limit = value; } } | public int Limit { set { _limit = value; } } | ||||
internal Optional<ulong> _afterUserId; | |||||
internal Optional<ulong> _afterUserId { get; set; } | |||||
public ulong AfterUserId { set { _afterUserId = value; } } | public ulong AfterUserId { set { _afterUserId = value; } } | ||||
} | } | ||||
} | } |
@@ -7,11 +7,11 @@ namespace Discord.API.Rest | |||||
public class ModifyCurrentUserParams | public class ModifyCurrentUserParams | ||||
{ | { | ||||
[JsonProperty("username")] | [JsonProperty("username")] | ||||
internal Optional<string> _username; | |||||
internal Optional<string> _username { get; set; } | |||||
public string Username { set { _username = value; } } | public string Username { set { _username = value; } } | ||||
[JsonProperty("avatar")] | [JsonProperty("avatar")] | ||||
internal Optional<Image> _avatar; | |||||
internal Optional<Image> _avatar { get; set; } | |||||
public Stream Avatar { set { _avatar = new Image(value); } } | public Stream Avatar { set { _avatar = new Image(value); } } | ||||
} | } | ||||
} | } |
@@ -6,11 +6,11 @@ namespace Discord.API.Rest | |||||
public class ModifyGuildChannelParams | public class ModifyGuildChannelParams | ||||
{ | { | ||||
[JsonProperty("name")] | [JsonProperty("name")] | ||||
internal Optional<string> _name; | |||||
internal Optional<string> _name { get; set; } | |||||
public string Name { set { _name = value; } } | public string Name { set { _name = value; } } | ||||
[JsonProperty("position")] | [JsonProperty("position")] | ||||
internal Optional<int> _position; | |||||
internal Optional<int> _position { get; set; } | |||||
public int Position { set { _position = value; } } | public int Position { set { _position = value; } } | ||||
} | } | ||||
} | } |
@@ -6,11 +6,11 @@ namespace Discord.API.Rest | |||||
public class ModifyGuildEmbedParams | public class ModifyGuildEmbedParams | ||||
{ | { | ||||
[JsonProperty("enabled")] | [JsonProperty("enabled")] | ||||
internal Optional<bool> _enabled; | |||||
internal Optional<bool> _enabled { get; set; } | |||||
public bool Enabled { set { _enabled = value; } } | public bool Enabled { set { _enabled = value; } } | ||||
[JsonProperty("channel")] | [JsonProperty("channel")] | ||||
internal Optional<ulong?> _channelId; | |||||
internal Optional<ulong?> _channelId { get; set; } | |||||
public ulong? ChannelId { set { _channelId = value; } } | public ulong? ChannelId { set { _channelId = value; } } | ||||
public IVoiceChannel Channel { set { _channelId = value != null ? value.Id : (ulong?)null; } } | public IVoiceChannel Channel { set { _channelId = value != null ? value.Id : (ulong?)null; } } | ||||
} | } | ||||
@@ -6,15 +6,15 @@ namespace Discord.API.Rest | |||||
public class ModifyGuildIntegrationParams | public class ModifyGuildIntegrationParams | ||||
{ | { | ||||
[JsonProperty("expire_behavior")] | [JsonProperty("expire_behavior")] | ||||
internal Optional<int> _expireBehavior; | |||||
internal Optional<int> _expireBehavior { get; set; } | |||||
public int ExpireBehavior { set { _expireBehavior = value; } } | public int ExpireBehavior { set { _expireBehavior = value; } } | ||||
[JsonProperty("expire_grace_period")] | [JsonProperty("expire_grace_period")] | ||||
internal Optional<int> _expireGracePeriod; | |||||
internal Optional<int> _expireGracePeriod { get; set; } | |||||
public int ExpireGracePeriod { set { _expireGracePeriod = value; } } | public int ExpireGracePeriod { set { _expireGracePeriod = value; } } | ||||
[JsonProperty("enable_emoticons")] | [JsonProperty("enable_emoticons")] | ||||
internal Optional<bool> _enableEmoticons; | |||||
internal Optional<bool> _enableEmoticons { get; set; } | |||||
public bool EnableEmoticons { set { _enableEmoticons = value; } } | public bool EnableEmoticons { set { _enableEmoticons = value; } } | ||||
} | } | ||||
} | } |
@@ -8,24 +8,24 @@ namespace Discord.API.Rest | |||||
public class ModifyGuildMemberParams | public class ModifyGuildMemberParams | ||||
{ | { | ||||
[JsonProperty("mute")] | [JsonProperty("mute")] | ||||
internal Optional<bool> _mute; | |||||
internal Optional<bool> _mute { get; set; } | |||||
public bool Mute { set { _mute = value; } } | public bool Mute { set { _mute = value; } } | ||||
[JsonProperty("deaf")] | [JsonProperty("deaf")] | ||||
internal Optional<bool> _deaf; | |||||
internal Optional<bool> _deaf { get; set; } | |||||
public bool Deaf { set { _deaf = value; } } | public bool Deaf { set { _deaf = value; } } | ||||
[JsonProperty("nick")] | [JsonProperty("nick")] | ||||
internal Optional<string> _nickname; | |||||
internal Optional<string> _nickname { get; set; } | |||||
public string Nickname { set { _nickname = value; } } | public string Nickname { set { _nickname = value; } } | ||||
[JsonProperty("roles")] | [JsonProperty("roles")] | ||||
internal Optional<ulong[]> _roleIds; | |||||
internal Optional<ulong[]> _roleIds { get; set; } | |||||
public IEnumerable<ulong> RoleIds { set { _roleIds = value.ToArray(); } } | public IEnumerable<ulong> RoleIds { set { _roleIds = value.ToArray(); } } | ||||
public IEnumerable<IRole> Roles { set { _roleIds = value.Select(x => x.Id).ToArray(); } } | public IEnumerable<IRole> Roles { set { _roleIds = value.Select(x => x.Id).ToArray(); } } | ||||
[JsonProperty("channel_id")] | [JsonProperty("channel_id")] | ||||
internal Optional<ulong> _channelId; | |||||
internal Optional<ulong> _channelId { get; set; } | |||||
public ulong VoiceChannelId { set { _channelId = value; } } | public ulong VoiceChannelId { set { _channelId = value; } } | ||||
public IVoiceChannel VoiceChannel { set { _channelId = value.Id; } } | public IVoiceChannel VoiceChannel { set { _channelId = value.Id; } } | ||||
} | } | ||||
@@ -7,44 +7,44 @@ namespace Discord.API.Rest | |||||
public class ModifyGuildParams | public class ModifyGuildParams | ||||
{ | { | ||||
[JsonProperty("username")] | [JsonProperty("username")] | ||||
internal Optional<string> _username; | |||||
internal Optional<string> _username { get; set; } | |||||
public string Username { set { _username = value; } } | public string Username { set { _username = value; } } | ||||
[JsonProperty("name")] | [JsonProperty("name")] | ||||
internal Optional<string> _name; | |||||
internal Optional<string> _name { get; set; } | |||||
public string Name { set { _name = value; } } | public string Name { set { _name = value; } } | ||||
[JsonProperty("region")] | [JsonProperty("region")] | ||||
internal Optional<IVoiceRegion> _region; | |||||
internal Optional<IVoiceRegion> _region { get; set; } | |||||
public IVoiceRegion Region { set { _region = Optional.Create(value); } } | public IVoiceRegion Region { set { _region = Optional.Create(value); } } | ||||
[JsonProperty("verification_level")] | [JsonProperty("verification_level")] | ||||
internal Optional<VerificationLevel> _verificationLevel; | |||||
internal Optional<VerificationLevel> _verificationLevel { get; set; } | |||||
public VerificationLevel VerificationLevel { set { _verificationLevel = value; } } | public VerificationLevel VerificationLevel { set { _verificationLevel = value; } } | ||||
[JsonProperty("default_message_notifications")] | [JsonProperty("default_message_notifications")] | ||||
internal Optional<DefaultMessageNotifications> _defaultMessageNotifications; | |||||
internal Optional<DefaultMessageNotifications> _defaultMessageNotifications { get; set; } | |||||
public DefaultMessageNotifications DefaultMessageNotifications { set { _defaultMessageNotifications = value; } } | public DefaultMessageNotifications DefaultMessageNotifications { set { _defaultMessageNotifications = value; } } | ||||
[JsonProperty("afk_timeout")] | [JsonProperty("afk_timeout")] | ||||
internal Optional<int> _afkTimeout; | |||||
internal Optional<int> _afkTimeout { get; set; } | |||||
public int AFKTimeout { set { _afkTimeout = value; } } | public int AFKTimeout { set { _afkTimeout = value; } } | ||||
[JsonProperty("icon")] | [JsonProperty("icon")] | ||||
internal Optional<Image?> _icon; | |||||
internal Optional<Image?> _icon { get; set; } | |||||
public Stream Icon { set { _icon = value != null ? new Image(value) : (Image?)null; } } | public Stream Icon { set { _icon = value != null ? new Image(value) : (Image?)null; } } | ||||
[JsonProperty("splash")] | [JsonProperty("splash")] | ||||
internal Optional<Image?> _splash; | |||||
internal Optional<Image?> _splash { get; set; } | |||||
public Stream Splash { set { _splash = value != null ? new Image(value) : (Image?)null; } } | public Stream Splash { set { _splash = value != null ? new Image(value) : (Image?)null; } } | ||||
[JsonProperty("afk_channel_id")] | [JsonProperty("afk_channel_id")] | ||||
internal Optional<ulong?> _afkChannelId; | |||||
internal Optional<ulong?> _afkChannelId { get; set; } | |||||
public ulong? AFKChannelId { set { _afkChannelId = value; } } | public ulong? AFKChannelId { set { _afkChannelId = value; } } | ||||
public IVoiceChannel AFKChannel { set { _afkChannelId = value?.Id; } } | public IVoiceChannel AFKChannel { set { _afkChannelId = value?.Id; } } | ||||
[JsonProperty("owner_id")] | [JsonProperty("owner_id")] | ||||
internal Optional<ulong> _ownerId; | |||||
internal Optional<ulong> _ownerId { get; set; } | |||||
public ulong OwnerId { set { _ownerId = value; } } | public ulong OwnerId { set { _ownerId = value; } } | ||||
public IGuildUser Owner { set { _ownerId = value.Id; } } | public IGuildUser Owner { set { _ownerId = value.Id; } } | ||||
} | } | ||||
@@ -6,23 +6,23 @@ namespace Discord.API.Rest | |||||
public class ModifyGuildRoleParams | public class ModifyGuildRoleParams | ||||
{ | { | ||||
[JsonProperty("name")] | [JsonProperty("name")] | ||||
internal Optional<string> _name; | |||||
internal Optional<string> _name { get; set; } | |||||
public string Name { set { _name = value; } } | public string Name { set { _name = value; } } | ||||
[JsonProperty("permissions")] | [JsonProperty("permissions")] | ||||
internal Optional<ulong> _permissions; | |||||
internal Optional<ulong> _permissions { get; set; } | |||||
public ulong Permissions { set { _permissions = value; } } | public ulong Permissions { set { _permissions = value; } } | ||||
[JsonProperty("position")] | [JsonProperty("position")] | ||||
internal Optional<int> _position; | |||||
internal Optional<int> _position { get; set; } | |||||
public int Position { set { _position = value; } } | public int Position { set { _position = value; } } | ||||
[JsonProperty("color")] | [JsonProperty("color")] | ||||
internal Optional<uint> _color; | |||||
internal Optional<uint> _color { get; set; } | |||||
public uint Color { set { _color = value; } } | public uint Color { set { _color = value; } } | ||||
[JsonProperty("hoist")] | [JsonProperty("hoist")] | ||||
internal Optional<bool> _hoist; | |||||
internal Optional<bool> _hoist { get; set; } | |||||
public bool Hoist { set { _hoist = value; } } | public bool Hoist { set { _hoist = value; } } | ||||
} | } | ||||
} | } |
@@ -6,7 +6,7 @@ namespace Discord.API.Rest | |||||
public class ModifyMessageParams | public class ModifyMessageParams | ||||
{ | { | ||||
[JsonProperty("content")] | [JsonProperty("content")] | ||||
internal Optional<string> _content; | |||||
internal Optional<string> _content { get; set; } | |||||
public string Content { set { _content = value; } } | public string Content { set { _content = value; } } | ||||
} | } | ||||
} | } |
@@ -2,10 +2,10 @@ | |||||
{ | { | ||||
public class ModifyPresenceParams | public class ModifyPresenceParams | ||||
{ | { | ||||
internal Optional<UserStatus> _status; | |||||
internal Optional<UserStatus> _status { get; set; } | |||||
public UserStatus Status { set { _status = value; } } | public UserStatus Status { set { _status = value; } } | ||||
internal Optional<Discord.Game> _game; | |||||
internal Optional<Discord.Game> _game { get; set; } | |||||
public Discord.Game Game { set { _game = value; } } | public Discord.Game Game { set { _game = value; } } | ||||
} | } | ||||
} | } |
@@ -6,7 +6,7 @@ namespace Discord.API.Rest | |||||
public class ModifyTextChannelParams : ModifyGuildChannelParams | public class ModifyTextChannelParams : ModifyGuildChannelParams | ||||
{ | { | ||||
[JsonProperty("topic")] | [JsonProperty("topic")] | ||||
internal Optional<string> _topic; | |||||
internal Optional<string> _topic { get; set; } | |||||
public string Topic { set { _topic = value; } } | public string Topic { set { _topic = value; } } | ||||
} | } | ||||
} | } |
@@ -6,11 +6,11 @@ namespace Discord.API.Rest | |||||
public class ModifyVoiceChannelParams : ModifyGuildChannelParams | public class ModifyVoiceChannelParams : ModifyGuildChannelParams | ||||
{ | { | ||||
[JsonProperty("bitrate")] | [JsonProperty("bitrate")] | ||||
internal Optional<int> _bitrate; | |||||
internal Optional<int> _bitrate { get; set; } | |||||
public int Bitrate { set { _bitrate = value; } } | public int Bitrate { set { _bitrate = value; } } | ||||
[JsonProperty("user_limit")] | [JsonProperty("user_limit")] | ||||
internal Optional<int> _userLimit; | |||||
internal Optional<int> _userLimit { get; set; } | |||||
public int UserLimit { set { _userLimit = value; } } | public int UserLimit { set { _userLimit = value; } } | ||||
} | } | ||||
} | } |
@@ -8,16 +8,16 @@ namespace Discord.API.Rest | |||||
{ | { | ||||
public Stream File { internal get; set; } | public Stream File { internal get; set; } | ||||
internal Optional<string> _filename; | |||||
internal Optional<string> _filename { get; set; } | |||||
public string Filename { set { _filename = value; } } | public string Filename { set { _filename = value; } } | ||||
internal Optional<string> _content; | |||||
internal Optional<string> _content { get; set; } | |||||
public string Content { set { _content = value; } } | public string Content { set { _content = value; } } | ||||
internal Optional<string> _nonce; | |||||
internal Optional<string> _nonce { get; set; } | |||||
public string Nonce { set { _nonce = value; } } | public string Nonce { set { _nonce = value; } } | ||||
internal Optional<bool> _isTTS; | |||||
internal Optional<bool> _isTTS { get; set; } | |||||
public bool IsTTS { set { _isTTS = value; } } | public bool IsTTS { set { _isTTS = value; } } | ||||
public UploadFileParams(Stream file) | public UploadFileParams(Stream file) | ||||