feature: Add INVITE_CREATE and INVITE_DELETE events (#1491)

* Add invite events (create and delete)

* Removed unused using

* Fixing IInviteMetadata properties

* Add two new fields to the gateway event

* Better event summary and remarks

* Change how to assign to target variable

Co-Authored-By: Joe4evr <jii.geugten@gmail.com>

* Applying suggested changes to TargetUserType

* Renaming NotDefined to Undefined

* Fixing xml docs

* Changed the summary style format

Co-authored-by: Joe4evr <jii.geugten@gmail.com>
This commit is contained in:
Paulo
2020-11-08 17:33:37 -03:00
committed by GitHub
parent a2af9857ca
commit 1ab670b3fc
7 changed files with 305 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
using Newtonsoft.Json;
using System;
namespace Discord.API.Gateway
{
internal class InviteCreateEvent
{
[JsonProperty("channel_id")]
public ulong ChannelId { get; set; }
[JsonProperty("code")]
public string Code { get; set; }
[JsonProperty("created_at")]
public DateTimeOffset CreatedAt { get; set; }
[JsonProperty("guild_id")]
public Optional<ulong> GuildId { get; set; }
[JsonProperty("inviter")]
public Optional<User> Inviter { get; set; }
[JsonProperty("max_age")]
public int MaxAge { get; set; }
[JsonProperty("max_uses")]
public int MaxUses { get; set; }
[JsonProperty("target_user")]
public Optional<User> TargetUser { get; set; }
[JsonProperty("target_user_type")]
public Optional<TargetUserType> TargetUserType { get; set; }
[JsonProperty("temporary")]
public bool Temporary { get; set; }
[JsonProperty("uses")]
public int Uses { get; set; }
}
}

View File

@@ -0,0 +1,14 @@
using Newtonsoft.Json;
namespace Discord.API.Gateway
{
internal class InviteDeleteEvent
{
[JsonProperty("channel_id")]
public ulong ChannelId { get; set; }
[JsonProperty("code")]
public string Code { get; set; }
[JsonProperty("guild_id")]
public Optional<ulong> GuildId { get; set; }
}
}