Initial commit, basic proxying working

This commit is contained in:
Ske
2020-12-22 13:15:26 +01:00
parent c3f6becea4
commit a6fbd869be
109 changed files with 3539 additions and 359 deletions

View File

@@ -0,0 +1,27 @@
using System.Collections.Generic;
namespace Myriad.Types
{
public record Application: ApplicationPartial
{
public string Name { get; init; }
public string? Icon { get; init; }
public string Description { get; init; }
public string[]? RpcOrigins { get; init; }
public bool BotPublic { get; init; }
public bool BotRequireCodeGrant { get; init; }
public User Owner { get; init; } // TODO: docs specify this is "partial", what does that mean
public string Summary { get; init; }
public string VerifyKey { get; init; }
public ulong? GuildId { get; init; }
public ulong? PrimarySkuId { get; init; }
public string? Slug { get; init; }
public string? CoverImage { get; init; }
}
public record ApplicationPartial
{
public ulong Id { get; init; }
public int Flags { get; init; }
}
}

View File

@@ -0,0 +1,13 @@
using System.Collections.Generic;
namespace Myriad.Types
{
public record ApplicationCommand
{
public ulong Id { get; init; }
public ulong ApplicationId { get; init; }
public string Name { get; init; }
public string Description { get; init; }
public ApplicationCommandOption[]? Options { get; init; }
}
}

View File

@@ -0,0 +1,9 @@
namespace Myriad.Types
{
public record ApplicationCommandInteractionData
{
public ulong Id { get; init; }
public string Name { get; init; }
public ApplicationCommandInteractionDataOption[] Options { get; init; }
}
}

View File

@@ -0,0 +1,9 @@
namespace Myriad.Types
{
public record ApplicationCommandInteractionDataOption
{
public string Name { get; init; }
public object? Value { get; init; }
public ApplicationCommandInteractionDataOption[]? Options { get; init; }
}
}

View File

@@ -0,0 +1,24 @@
namespace Myriad.Types
{
public record ApplicationCommandOption(ApplicationCommandOption.OptionType Type, string Name, string Description)
{
public enum OptionType
{
Subcommand = 1,
SubcommandGroup = 2,
String = 3,
Integer = 4,
Boolean = 5,
User = 6,
Channel = 7,
Role = 8
}
public bool Default { get; init; }
public bool Required { get; init; }
public Choice[]? Choices { get; init; }
public ApplicationCommandOption[]? Options { get; init; }
public record Choice(string Name, object Value);
}
}

View File

@@ -0,0 +1,19 @@
namespace Myriad.Types
{
public record Interaction
{
public enum InteractionType
{
Ping = 1,
ApplicationCommand = 2
}
public ulong Id { get; init; }
public InteractionType Type { get; init; }
public ApplicationCommandInteractionData? Data { get; init; }
public ulong GuildId { get; init; }
public ulong ChannelId { get; init; }
public GuildMember Member { get; init; }
public string Token { get; init; }
}
}

View File

@@ -0,0 +1,15 @@
using System.Collections.Generic;
using Myriad.Rest.Types;
namespace Myriad.Types
{
public record InteractionApplicationCommandCallbackData
{
public bool? Tts { get; init; }
public string Content { get; init; }
public Embed[]? Embeds { get; init; }
public AllowedMentions? AllowedMentions { get; init; }
public Message.MessageFlags Flags { get; init; }
}
}

View File

@@ -0,0 +1,17 @@
namespace Myriad.Types
{
public record InteractionResponse
{
public enum ResponseType
{
Pong = 1,
Acknowledge = 2,
ChannelMessage = 3,
ChannelMessageWithSource = 4,
AckWithSource = 5
}
public ResponseType Type { get; init; }
public InteractionApplicationCommandCallbackData? Data { get; init; }
}
}