Preliminary support for APIv9 and threads
This commit is contained in:
@@ -6,5 +6,6 @@ namespace Myriad.Gateway
|
||||
{
|
||||
public Channel[] Channels { get; init; }
|
||||
public GuildMember[] Members { get; init; }
|
||||
public Channel[] Threads { get; init; }
|
||||
}
|
||||
}
|
@@ -21,6 +21,10 @@ namespace Myriad.Gateway
|
||||
{"CHANNEL_CREATE", typeof(ChannelCreateEvent)},
|
||||
{"CHANNEL_UPDATE", typeof(ChannelUpdateEvent)},
|
||||
{"CHANNEL_DELETE", typeof(ChannelDeleteEvent)},
|
||||
{"THREAD_CREATE", typeof(ThreadCreateEvent)},
|
||||
{"THREAD_UPDATE", typeof(ThreadUpdateEvent)},
|
||||
{"THREAD_DELETE", typeof(ThreadDeleteEvent)},
|
||||
{"THREAD_LIST_SYNC", typeof(ThreadListSyncEvent)},
|
||||
{"MESSAGE_CREATE", typeof(MessageCreateEvent)},
|
||||
{"MESSAGE_UPDATE", typeof(MessageUpdateEvent)},
|
||||
{"MESSAGE_DELETE", typeof(MessageDeleteEvent)},
|
||||
|
6
Myriad/Gateway/Events/ThreadCreateEvent.cs
Normal file
6
Myriad/Gateway/Events/ThreadCreateEvent.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
using Myriad.Types;
|
||||
|
||||
namespace Myriad.Gateway
|
||||
{
|
||||
public record ThreadCreateEvent: Channel, IGatewayEvent;
|
||||
}
|
12
Myriad/Gateway/Events/ThreadDeleteEvent.cs
Normal file
12
Myriad/Gateway/Events/ThreadDeleteEvent.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using Myriad.Types;
|
||||
|
||||
namespace Myriad.Gateway
|
||||
{
|
||||
public record ThreadDeleteEvent: IGatewayEvent
|
||||
{
|
||||
public ulong Id { get; init; }
|
||||
public ulong? GuildId { get; init; }
|
||||
public ulong? ParentId { get; init; }
|
||||
public Channel.ChannelType Type { get; init; }
|
||||
}
|
||||
}
|
11
Myriad/Gateway/Events/ThreadListSyncEvent.cs
Normal file
11
Myriad/Gateway/Events/ThreadListSyncEvent.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using Myriad.Types;
|
||||
|
||||
namespace Myriad.Gateway
|
||||
{
|
||||
public record ThreadListSyncEvent: IGatewayEvent
|
||||
{
|
||||
public ulong GuildId { get; init; }
|
||||
public ulong[]? ChannelIds { get; init; }
|
||||
public Channel[] Threads { get; init; }
|
||||
}
|
||||
}
|
6
Myriad/Gateway/Events/ThreadUpdateEvent.cs
Normal file
6
Myriad/Gateway/Events/ThreadUpdateEvent.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
using Myriad.Types;
|
||||
|
||||
namespace Myriad.Gateway
|
||||
{
|
||||
public record ThreadUpdateEvent: Channel, IGatewayEvent;
|
||||
}
|
@@ -82,7 +82,7 @@ namespace Myriad.Gateway
|
||||
|
||||
private Uri GetConnectionUri(string baseUri) => new UriBuilder(baseUri)
|
||||
{
|
||||
Query = "v=8&encoding=json"
|
||||
Query = "v=9&encoding=json"
|
||||
}.Uri;
|
||||
|
||||
private async Task CloseInner(WebSocketCloseStatus closeStatus, string? description)
|
||||
|
Reference in New Issue
Block a user