Create all interaction models

This commit is contained in:
Daan Boerlage 2021-09-20 01:28:26 +02:00
parent 209887e237
commit 60547140ea
Signed by: daan
GPG key ID: FCE070E1E4956606
59 changed files with 1589 additions and 222 deletions

View file

@ -0,0 +1,34 @@
using System.Text.Json.Serialization;
namespace Geekbot.Core.Interactions.Resolved
{
public record Attachment
{
[JsonPropertyName("id")]
public string Id { get; set; }
[JsonPropertyName("filename")]
public string Filename { get; set; }
[JsonPropertyName("content_type")]
public string ContentType { get; set; }
[JsonPropertyName("size")]
public int Size { get; set; }
[JsonPropertyName("url")]
public string Url { get; set; }
[JsonPropertyName("proxy_url")]
public string ProxyUrl { get; set; }
[JsonPropertyName("height")]
public int Height { get; set; }
[JsonPropertyName("width")]
public int Width { get; set; }
[JsonPropertyName("ephemeral")]
public bool Ephemeral { get; set; }
}
}

View file

@ -0,0 +1,25 @@
using System.Text.Json.Serialization;
namespace Geekbot.Core.Interactions.Resolved
{
public record Channel
{
[JsonPropertyName("id")]
public string Id { get; set; }
[JsonPropertyName("type")]
public ChannelType Type { get; set; }
[JsonPropertyName("name")]
public string Name { get; set; }
[JsonPropertyName("parent_id")]
public string ParentId { get; set; }
[JsonPropertyName("thread_metadata")]
public ThreadMetadata ThreadMetadata { get; set; }
[JsonPropertyName("permissions")]
public string Permissions { get; set; }
}
}

View file

@ -0,0 +1,17 @@
namespace Geekbot.Core.Interactions.Resolved
{
public enum ChannelType
{
GuildText = 0,
Dm = 1,
GuildVoice = 2,
GroupDm = 3,
GuildCategory = 4,
GuildNews = 5,
GuildStore = 6,
GuildNewsThread = 10,
GuildPublicThread = 11,
GuildPrivateThread = 12,
GuildStageVoice = 13,
}
}

View file

@ -0,0 +1,32 @@
using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace Geekbot.Core.Interactions.Resolved
{
public record Emoji
{
[JsonPropertyName("id")]
public string Id { get; set; }
[JsonPropertyName("name")]
public string Name { get; set; }
[JsonPropertyName("roles")]
public List<string> Roles { get; set; }
[JsonPropertyName("user")]
public User User { get; set; }
[JsonPropertyName("require_colons")]
public bool RequireColons { get; set; }
[JsonPropertyName("managed")]
public bool Managed { get; set; }
[JsonPropertyName("animated")]
public bool Animated { get; set; }
[JsonPropertyName("available")]
public bool Available { get; set; }
}
}

View file

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace Geekbot.Core.Interactions.Resolved
{
public record Member
{
[JsonPropertyName("nick")]
public string Nick { get; set; }
[JsonPropertyName("roles")]
public List<string> Roles { get; set; }
[JsonPropertyName("joined_at")]
public DateTime JoinedAt { get; set; }
[JsonPropertyName("premium_since")]
public DateTime? PremiumSince { get; set; }
[JsonPropertyName("pending")]
public bool Pending { get; set; }
[JsonPropertyName("permissions")]
public string Permissions { get; set; }
}
}

View file

@ -0,0 +1,103 @@
using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace Geekbot.Core.Interactions.Resolved
{
public record Message
{
[JsonPropertyName("id")]
public string Id { get; set; }
[JsonPropertyName("channel_id")]
public string ChannelId { get; set; }
[JsonPropertyName("guild_id")]
public string GuildId { get; set; }
[JsonPropertyName("author")]
public User Author { get; set; }
[JsonPropertyName("member")]
public Member Member { get; set; }
[JsonPropertyName("content")]
public string Content { get; set; }
[JsonPropertyName("timestamp")]
public DateTime Timestamp { get; set; }
[JsonPropertyName("edited_timestamp")]
public DateTime? EditedTimestamp { get; set; }
[JsonPropertyName("tts")]
public bool Tts { get; set; }
[JsonPropertyName("mention_everyone")]
public bool MentionEveryone { get; set; }
[JsonPropertyName("mentions")]
public List<User> Mentions { get; set; }
[JsonPropertyName("mention_roles")]
public List<Role> MentionRoles { get; set; }
[JsonPropertyName("mention_channels")]
public List<Channel> MentionChannels { get; set; }
[JsonPropertyName("attachments")]
public List<Attachment> Attachments { get; set; }
[JsonPropertyName("embeds")]
public List<Embed.Embed> Embeds { get; set; }
[JsonPropertyName("reactions")]
public List<Reaction> Reactions { get; set; }
// [JsonPropertyName("nonce")]
// public string Nonce { get; set; }
[JsonPropertyName("pinned")]
public bool Pinned { get; set; }
[JsonPropertyName("webhook_id")]
public string WebhookId { get; set; }
[JsonPropertyName("type")]
public MessageType Type { get; set; }
// [JsonPropertyName("activity")]
// public string Activity { get; set; }
// [JsonPropertyName("application")]
// public string Application { get; set; }
[JsonPropertyName("application_id")]
public string ApplicationId { get; set; }
// [JsonPropertyName("message_reference")]
// public string MessageReference { get; set; }
[JsonPropertyName("flags")]
public int Flags { get; set; }
[JsonPropertyName("referenced_message")]
public Message ReferencedMessage { get; set; }
[JsonPropertyName("interaction")]
public MessageInteraction Interaction { get; set; }
[JsonPropertyName("thread")]
public Channel Thread { get; set; }
// [JsonPropertyName("components")]
// public string Components { get; set; }
// [JsonPropertyName("sticker_items")]
// public string StickerItems { get; set; }
// [JsonPropertyName("stickers")]
// public string Stickers { get; set; }
}
}

View file

@ -0,0 +1,20 @@
using System.Text.Json.Serialization;
using Geekbot.Core.Interactions.Request;
namespace Geekbot.Core.Interactions.Resolved
{
public record MessageInteraction
{
[JsonPropertyName("id")]
public string Id { get; set; }
[JsonPropertyName("type")]
public InteractionType Type { get; set; }
[JsonPropertyName("name")]
public string Name { get; set; }
[JsonPropertyName("user")]
public User User { get; set; }
}
}

View file

@ -0,0 +1,29 @@
namespace Geekbot.Core.Interactions.Resolved
{
public enum MessageType
{
Default = 0,
RecipientAdd = 1,
RecipientRemove = 2,
Call = 3,
ChannelNameChange = 4,
ChannelIconChange = 5,
ChannelPinnedMessage = 6,
GuildMemberJoin = 7,
UserPremiumGuildSubscription = 8,
UserPremiumGuildSubscriptionTier1 = 9,
UserPremiumGuildSubscriptionTier2 = 10,
UserPremiumGuildSubscriptionTier3 = 11,
ChannelFollowAdd = 12,
GuildDiscoveryDisqualified = 14,
GuildDiscoveryRequalified = 15,
GuildDiscoveryGracePeriodInitialWarning = 16,
GuildDiscoveryGracePeriodFinalWarning = 17,
ThreadCreated = 18,
Reply = 19,
ChatInputCommand = 20,
ThreadStarterMessage = 21,
GuildInviteReminder = 22,
ContextMenuCommand = 23,
}
}

View file

@ -0,0 +1,16 @@
using System.Text.Json.Serialization;
namespace Geekbot.Core.Interactions.Resolved
{
public struct Reaction
{
[JsonPropertyName("count")]
public int Count { get; set; }
[JsonPropertyName("me")]
public bool Me { get; set; }
[JsonPropertyName("emoji")]
public Emoji emoji { get; set; }
}
}

View file

@ -0,0 +1,34 @@
using System.Text.Json.Serialization;
namespace Geekbot.Core.Interactions.Resolved
{
public record Role
{
[JsonPropertyName("id")]
public string Id { get; set; }
[JsonPropertyName("name")]
public string Name { get; set; }
[JsonPropertyName("color")]
public int Color { get; set; }
[JsonPropertyName("hoist")]
public bool Hoist { get; set; }
[JsonPropertyName("position")]
public int Position { get; set; }
[JsonPropertyName("permissions")]
public string Permissions { get; set; }
[JsonPropertyName("managed")]
public bool Managed { get; set; }
[JsonPropertyName("mentionable")]
public bool Mentionable { get; set; }
[JsonPropertyName("tags")]
public RoleTag Tags { get; set; }
}
}

View file

@ -0,0 +1,16 @@
using System.Text.Json.Serialization;
namespace Geekbot.Core.Interactions.Resolved
{
public record RoleTag
{
[JsonPropertyName("bot_id")]
public string BotId { get; set; }
[JsonPropertyName("integration_id")]
public string IntegrationId { get; set; }
[JsonPropertyName("premium_subscriber")]
public bool PremiumSubscriber { get; set; }
}
}

View file

@ -0,0 +1,23 @@
using System;
using System.Text.Json.Serialization;
namespace Geekbot.Core.Interactions.Resolved
{
public record ThreadMetadata
{
[JsonPropertyName("archived")]
public bool Archived { get; set; }
[JsonPropertyName("auto_archive_duration")]
public int AutoArchiveDuration { get; set; }
[JsonPropertyName("archive_timestamp")]
public DateTime ArchiveTimestamp { get; set; }
[JsonPropertyName("locked")]
public bool Locked { get; set; }
[JsonPropertyName("invitable")]
public bool Invitable { get; set; }
}
}

View file

@ -0,0 +1,52 @@
using System.Text.Json.Serialization;
namespace Geekbot.Core.Interactions.Resolved
{
public record User
{
[JsonPropertyName("id")]
public string Id { get; set; }
[JsonPropertyName("username")]
public string Username { get; set; }
[JsonPropertyName("discriminator")]
public string Discriminator { get; set; }
[JsonPropertyName("avatar")]
public string Avatar { get; set; }
[JsonPropertyName("bot")]
public bool Bot { get; set; }
[JsonPropertyName("system")]
public bool System { get; set; }
[JsonPropertyName("mfa_enabled")]
public bool MfaEnabled { get; set; }
[JsonPropertyName("banner")]
public string Banner { get; set; }
[JsonPropertyName("accent_color")]
public int AccentColor { get; set; }
[JsonPropertyName("locale")]
public string Locale { get; set; }
[JsonPropertyName("verified")]
public bool Verified { get; set; }
[JsonPropertyName("email")]
public string Email { get; set; }
[JsonPropertyName("flags")]
public int Flags { get; set; }
[JsonPropertyName("premium_type")]
public int PremiumType { get; set; }
[JsonPropertyName("public_flags")]
public int PublicFlags { get; set; }
}
}