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:
31
src/Discord.Net.WebSocket/API/Gateway/InviteCreateEvent.cs
Normal file
31
src/Discord.Net.WebSocket/API/Gateway/InviteCreateEvent.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
14
src/Discord.Net.WebSocket/API/Gateway/InviteDeleteEvent.cs
Normal file
14
src/Discord.Net.WebSocket/API/Gateway/InviteDeleteEvent.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user