Move all interaction classes to its own project
This commit is contained in:
parent
54cbb00880
commit
a460041c52
65 changed files with 142 additions and 140 deletions
|
@ -13,6 +13,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bot", "src\Bot\Bot.csproj",
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands", "src\Commands\Commands.csproj", "{7C771DFE-912A-4276-B0A6-047E09603F1E}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands", "src\Commands\Commands.csproj", "{7C771DFE-912A-4276-B0A6-047E09603F1E}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Interactions", "src\Interactions\Interactions.csproj", "{FF6859D9-C539-4910-BE1E-9ECFED2F46FA}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
@ -39,6 +41,10 @@ Global
|
||||||
{7C771DFE-912A-4276-B0A6-047E09603F1E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{7C771DFE-912A-4276-B0A6-047E09603F1E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{7C771DFE-912A-4276-B0A6-047E09603F1E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{7C771DFE-912A-4276-B0A6-047E09603F1E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{7C771DFE-912A-4276-B0A6-047E09603F1E}.Release|Any CPU.Build.0 = Release|Any CPU
|
{7C771DFE-912A-4276-B0A6-047E09603F1E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{FF6859D9-C539-4910-BE1E-9ECFED2F46FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{FF6859D9-C539-4910-BE1E-9ECFED2F46FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{FF6859D9-C539-4910-BE1E-9ECFED2F46FA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{FF6859D9-C539-4910-BE1E-9ECFED2F46FA}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|
|
@ -47,14 +47,14 @@ namespace Geekbot.Bot.Commands.User
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var author = new Core.Interactions.Resolved.User()
|
var author = new Interactions.Resolved.User()
|
||||||
{
|
{
|
||||||
Id = Context.User.Id.ToString(),
|
Id = Context.User.Id.ToString(),
|
||||||
Username = Context.User.Username,
|
Username = Context.User.Username,
|
||||||
Discriminator = Context.User.Discriminator,
|
Discriminator = Context.User.Discriminator,
|
||||||
Avatar = Context.User.AvatarId,
|
Avatar = Context.User.AvatarId,
|
||||||
};
|
};
|
||||||
var targetUser = new Core.Interactions.Resolved.User()
|
var targetUser = new Interactions.Resolved.User()
|
||||||
{
|
{
|
||||||
Id = user.Id.ToString(),
|
Id = user.Id.ToString(),
|
||||||
Username = user.Username,
|
Username = user.Username,
|
||||||
|
|
|
@ -9,7 +9,7 @@ using Geekbot.Core.ErrorHandling;
|
||||||
using Geekbot.Core.GuildSettingsManager;
|
using Geekbot.Core.GuildSettingsManager;
|
||||||
using Geekbot.Core.Highscores;
|
using Geekbot.Core.Highscores;
|
||||||
|
|
||||||
namespace Geekbot.Bot.Commands.User.Ranking
|
namespace Geekbot.Bot.Commands.User
|
||||||
{
|
{
|
||||||
public class Rank : GeekbotCommandBase
|
public class Rank : GeekbotCommandBase
|
||||||
{
|
{
|
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Core\Core.csproj" />
|
<ProjectReference Include="..\Core\Core.csproj" />
|
||||||
|
<ProjectReference Include="..\Interactions\Interactions.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -2,8 +2,8 @@ using System.Drawing;
|
||||||
using Geekbot.Core;
|
using Geekbot.Core;
|
||||||
using Geekbot.Core.Database;
|
using Geekbot.Core.Database;
|
||||||
using Geekbot.Core.Database.Models;
|
using Geekbot.Core.Database.Models;
|
||||||
using Geekbot.Core.Interactions.Embed;
|
using Geekbot.Interactions.Embed;
|
||||||
using Geekbot.Core.Interactions.Resolved;
|
using Geekbot.Interactions.Resolved;
|
||||||
using Localization = Geekbot.Core.Localization;
|
using Localization = Geekbot.Core.Localization;
|
||||||
|
|
||||||
namespace Geekbot.Commands.Karma;
|
namespace Geekbot.Commands.Karma;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using Geekbot.Core;
|
using Geekbot.Core;
|
||||||
using Geekbot.Core.Interactions.Embed;
|
using Geekbot.Interactions.Embed;
|
||||||
|
|
||||||
namespace Geekbot.Commands.UrbanDictionary;
|
namespace Geekbot.Commands.UrbanDictionary;
|
||||||
|
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Geekbot.Core.Interactions.ApplicationCommand;
|
|
||||||
using Geekbot.Core.Interactions.Request;
|
|
||||||
using Geekbot.Core.Interactions.Response;
|
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions
|
|
||||||
{
|
|
||||||
public interface IInteractionCommandManager
|
|
||||||
{
|
|
||||||
Dictionary<string, Command> CommandsInfo { get; init; }
|
|
||||||
Task<InteractionResponse> RunCommand(Interaction interaction);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,7 +1,6 @@
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions.ApplicationCommand
|
namespace Geekbot.Interactions.ApplicationCommand
|
||||||
{
|
{
|
||||||
/// <see href="https://discord.com/developers/docs/interactions/application-commands#application-command-object"/>
|
/// <see href="https://discord.com/developers/docs/interactions/application-commands#application-command-object"/>
|
||||||
public record Command
|
public record Command
|
|
@ -1,4 +1,4 @@
|
||||||
namespace Geekbot.Core.Interactions.ApplicationCommand
|
namespace Geekbot.Interactions.ApplicationCommand
|
||||||
{
|
{
|
||||||
/// <see href="https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-types"/>
|
/// <see href="https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-types"/>
|
||||||
public enum CommandType
|
public enum CommandType
|
|
@ -1,7 +1,6 @@
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions.ApplicationCommand
|
namespace Geekbot.Interactions.ApplicationCommand
|
||||||
{
|
{
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Required options must be listed before optional options
|
/// Required options must be listed before optional options
|
|
@ -1,6 +1,6 @@
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions.ApplicationCommand
|
namespace Geekbot.Interactions.ApplicationCommand
|
||||||
{
|
{
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// If you specify choices for an option, they are the only valid values for a user to pick
|
/// If you specify choices for an option, they are the only valid values for a user to pick
|
|
@ -1,4 +1,4 @@
|
||||||
namespace Geekbot.Core.Interactions.ApplicationCommand
|
namespace Geekbot.Interactions.ApplicationCommand
|
||||||
{
|
{
|
||||||
/// <see href="https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-type"/>
|
/// <see href="https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-type"/>
|
||||||
public enum OptionType
|
public enum OptionType
|
|
@ -1,10 +1,8 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using Discord;
|
using Discord;
|
||||||
using Color = System.Drawing.Color;
|
using Color = System.Drawing.Color;
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions.Embed
|
namespace Geekbot.Interactions.Embed
|
||||||
{
|
{
|
||||||
/// <see href="https://discord.com/developers/docs/resources/channel#embed-object" />
|
/// <see href="https://discord.com/developers/docs/resources/channel#embed-object" />
|
||||||
public class Embed
|
public class Embed
|
|
@ -1,6 +1,6 @@
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions.Embed
|
namespace Geekbot.Interactions.Embed
|
||||||
{
|
{
|
||||||
public record EmbedAuthor
|
public record EmbedAuthor
|
||||||
{
|
{
|
|
@ -1,6 +1,6 @@
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions.Embed
|
namespace Geekbot.Interactions.Embed
|
||||||
{
|
{
|
||||||
/// <see href="https://discord.com/developers/docs/resources/channel#embed-object-embed-field-structure" />
|
/// <see href="https://discord.com/developers/docs/resources/channel#embed-object-embed-field-structure" />
|
||||||
public record EmbedField
|
public record EmbedField
|
|
@ -1,6 +1,6 @@
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions.Embed
|
namespace Geekbot.Interactions.Embed
|
||||||
{
|
{
|
||||||
/// <see href="https://discord.com/developers/docs/resources/channel#embed-object-embed-footer-structure" />
|
/// <see href="https://discord.com/developers/docs/resources/channel#embed-object-embed-footer-structure" />
|
||||||
public record EmbedFooter
|
public record EmbedFooter
|
|
@ -1,6 +1,6 @@
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions.Embed
|
namespace Geekbot.Interactions.Embed
|
||||||
{
|
{
|
||||||
/// <see href="https://discord.com/developers/docs/resources/channel#embed-object-embed-image-structure" />
|
/// <see href="https://discord.com/developers/docs/resources/channel#embed-object-embed-image-structure" />
|
||||||
public record EmbedImage
|
public record EmbedImage
|
|
@ -1,6 +1,6 @@
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions.Embed
|
namespace Geekbot.Interactions.Embed
|
||||||
{
|
{
|
||||||
/// <see href="https://discord.com/developers/docs/resources/channel#embed-object-embed-provider-structure" />
|
/// <see href="https://discord.com/developers/docs/resources/channel#embed-object-embed-provider-structure" />
|
||||||
public record EmbedProvider
|
public record EmbedProvider
|
|
@ -1,6 +1,6 @@
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions.Embed
|
namespace Geekbot.Interactions.Embed
|
||||||
{
|
{
|
||||||
/// <see href="https://discord.com/developers/docs/resources/channel#embed-object-embed-thumbnail-structure" />
|
/// <see href="https://discord.com/developers/docs/resources/channel#embed-object-embed-thumbnail-structure" />
|
||||||
public record EmbedThumbnail
|
public record EmbedThumbnail
|
|
@ -1,7 +1,7 @@
|
||||||
using System.Runtime.Serialization;
|
using System.Runtime.Serialization;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions.Embed
|
namespace Geekbot.Interactions.Embed
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Embed types are "loosely defined" and, for the most part, are not used by our clients for rendering.
|
/// Embed types are "loosely defined" and, for the most part, are not used by our clients for rendering.
|
|
@ -1,6 +1,6 @@
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions.Embed
|
namespace Geekbot.Interactions.Embed
|
||||||
{
|
{
|
||||||
/// <see href="https://discord.com/developers/docs/resources/channel#embed-object-embed-video-structure" />
|
/// <see href="https://discord.com/developers/docs/resources/channel#embed-object-embed-video-structure" />
|
||||||
public record EmbedVideo
|
public record EmbedVideo
|
|
@ -1,8 +1,7 @@
|
||||||
using System;
|
using Geekbot.Interactions.Request;
|
||||||
using Geekbot.Core.Interactions.Request;
|
using Geekbot.Interactions.Response;
|
||||||
using Geekbot.Core.Interactions.Response;
|
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions
|
namespace Geekbot.Interactions
|
||||||
{
|
{
|
||||||
public interface IInteractionBase
|
public interface IInteractionBase
|
||||||
{
|
{
|
12
src/Interactions/IInteractionCommandManager.cs
Normal file
12
src/Interactions/IInteractionCommandManager.cs
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
using Geekbot.Interactions.ApplicationCommand;
|
||||||
|
using Geekbot.Interactions.Request;
|
||||||
|
using Geekbot.Interactions.Response;
|
||||||
|
|
||||||
|
namespace Geekbot.Interactions
|
||||||
|
{
|
||||||
|
public interface IInteractionCommandManager
|
||||||
|
{
|
||||||
|
Dictionary<string, Command> CommandsInfo { get; init; }
|
||||||
|
Task<InteractionResponse> RunCommand(Interaction interaction);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,11 +1,10 @@
|
||||||
using System;
|
using Geekbot.Interactions.ApplicationCommand;
|
||||||
using System.Threading.Tasks;
|
using Geekbot.Interactions.Request;
|
||||||
using Geekbot.Core.Interactions.ApplicationCommand;
|
using Geekbot.Interactions.Response;
|
||||||
using Geekbot.Core.Interactions.Request;
|
|
||||||
using Geekbot.Core.Interactions.Response;
|
|
||||||
using Sentry;
|
using Sentry;
|
||||||
|
using Localization = Geekbot.Core.Localization;
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions
|
namespace Geekbot.Interactions
|
||||||
{
|
{
|
||||||
public abstract class InteractionBase : IInteractionBase
|
public abstract class InteractionBase : IInteractionBase
|
||||||
{
|
{
|
|
@ -1,17 +1,12 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Geekbot.Core.GuildSettingsManager;
|
using Geekbot.Core.GuildSettingsManager;
|
||||||
using Geekbot.Core.Interactions.ApplicationCommand;
|
using Geekbot.Interactions.ApplicationCommand;
|
||||||
using Geekbot.Core.Interactions.Request;
|
using Geekbot.Interactions.Request;
|
||||||
using Geekbot.Core.Interactions.Response;
|
using Geekbot.Interactions.Response;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions
|
namespace Geekbot.Interactions
|
||||||
{
|
{
|
||||||
public class InteractionCommandManager : IInteractionCommandManager
|
public class InteractionCommandManager : IInteractionCommandManager
|
||||||
{
|
{
|
21
src/Interactions/Interactions.csproj
Normal file
21
src/Interactions/Interactions.csproj
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
<RuntimeIdentifiers>win10-x64;linux-x64;linux-musl-x64</RuntimeIdentifiers>
|
||||||
|
<VersionSuffix>$(VersionSuffix)</VersionSuffix>
|
||||||
|
<Version Condition=" '$(VersionSuffix)' != '' ">$(VersionSuffix)</Version>
|
||||||
|
<Version Condition=" '$(VersionSuffix)' == '' ">0.0.0-DEV</Version>
|
||||||
|
<RootNamespace>Geekbot.Interactions</RootNamespace>
|
||||||
|
<AssemblyName>Geekbot.Interactions</AssemblyName>
|
||||||
|
<NoWarn>NU1701</NoWarn>
|
||||||
|
<NoWarn>CS8618</NoWarn>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Core\Core.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
|
@ -1,4 +1,4 @@
|
||||||
namespace Geekbot.Core.Interactions.MessageComponents
|
namespace Geekbot.Interactions.MessageComponents
|
||||||
{
|
{
|
||||||
/// <see href="https://discord.com/developers/docs/interactions/message-components#button-object-button-styles" />
|
/// <see href="https://discord.com/developers/docs/interactions/message-components#button-object-button-styles" />
|
||||||
public enum ButtonStyle
|
public enum ButtonStyle
|
|
@ -1,7 +1,6 @@
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions.MessageComponents
|
namespace Geekbot.Interactions.MessageComponents
|
||||||
{
|
{
|
||||||
/// <see href="https://discord.com/developers/docs/interactions/message-components#component-object-component-structure"/>
|
/// <see href="https://discord.com/developers/docs/interactions/message-components#component-object-component-structure"/>
|
||||||
public record Component
|
public record Component
|
|
@ -1,6 +1,6 @@
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions.MessageComponents
|
namespace Geekbot.Interactions.MessageComponents
|
||||||
{
|
{
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Partial emoji with just id, name, and animated
|
/// Partial emoji with just id, name, and animated
|
|
@ -1,4 +1,4 @@
|
||||||
namespace Geekbot.Core.Interactions.MessageComponents
|
namespace Geekbot.Interactions.MessageComponents
|
||||||
{
|
{
|
||||||
/// <see href="https://discord.com/developers/docs/interactions/message-components#component-object-component-types" />
|
/// <see href="https://discord.com/developers/docs/interactions/message-components#component-object-component-types" />
|
||||||
public enum ComponentType
|
public enum ComponentType
|
|
@ -1,6 +1,6 @@
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions.MessageComponents
|
namespace Geekbot.Interactions.MessageComponents
|
||||||
{
|
{
|
||||||
/// <see href="https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-option-structure" />
|
/// <see href="https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-option-structure" />
|
||||||
public record SelectOption
|
public record SelectOption
|
|
@ -1,9 +1,7 @@
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using Geekbot.Core.Interactions.Resolved;
|
using Geekbot.Interactions.Resolved;
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions.Request
|
namespace Geekbot.Interactions.Request
|
||||||
{
|
{
|
||||||
/// <see href="https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-structure" />
|
/// <see href="https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-structure" />
|
||||||
public record Interaction
|
public record Interaction
|
|
@ -1,9 +1,8 @@
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using Geekbot.Core.Interactions.ApplicationCommand;
|
using Geekbot.Interactions.ApplicationCommand;
|
||||||
using Geekbot.Core.Interactions.MessageComponents;
|
using Geekbot.Interactions.MessageComponents;
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions.Request
|
namespace Geekbot.Interactions.Request
|
||||||
{
|
{
|
||||||
/// <see href="https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure" />
|
/// <see href="https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure" />
|
||||||
public class InteractionData
|
public class InteractionData
|
|
@ -1,9 +1,8 @@
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using Geekbot.Core.Interactions.ApplicationCommand;
|
using Geekbot.Interactions.ApplicationCommand;
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions.Request
|
namespace Geekbot.Interactions.Request
|
||||||
{
|
{
|
||||||
/// <see href="https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-interaction-data-option-structure" />
|
/// <see href="https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-interaction-data-option-structure" />
|
||||||
public record InteractionOption
|
public record InteractionOption
|
|
@ -1,8 +1,7 @@
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using Geekbot.Core.Interactions.Resolved;
|
using Geekbot.Interactions.Resolved;
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions.Request
|
namespace Geekbot.Interactions.Request
|
||||||
{
|
{
|
||||||
public class InteractionResolvedData
|
public class InteractionResolvedData
|
||||||
{
|
{
|
|
@ -1,4 +1,4 @@
|
||||||
namespace Geekbot.Core.Interactions.Request
|
namespace Geekbot.Interactions.Request
|
||||||
{
|
{
|
||||||
/// <see href="https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-type" />
|
/// <see href="https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-type" />
|
||||||
public enum InteractionType
|
public enum InteractionType
|
|
@ -1,6 +1,6 @@
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions.Resolved
|
namespace Geekbot.Interactions.Resolved
|
||||||
{
|
{
|
||||||
public record Attachment
|
public record Attachment
|
||||||
{
|
{
|
|
@ -1,6 +1,6 @@
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions.Resolved
|
namespace Geekbot.Interactions.Resolved
|
||||||
{
|
{
|
||||||
public record Channel
|
public record Channel
|
||||||
{
|
{
|
|
@ -1,4 +1,4 @@
|
||||||
namespace Geekbot.Core.Interactions.Resolved
|
namespace Geekbot.Interactions.Resolved
|
||||||
{
|
{
|
||||||
public enum ChannelType
|
public enum ChannelType
|
||||||
{
|
{
|
|
@ -1,7 +1,6 @@
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions.Resolved
|
namespace Geekbot.Interactions.Resolved
|
||||||
{
|
{
|
||||||
public record Emoji
|
public record Emoji
|
||||||
{
|
{
|
|
@ -1,8 +1,6 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions.Resolved
|
namespace Geekbot.Interactions.Resolved
|
||||||
{
|
{
|
||||||
public record Member
|
public record Member
|
||||||
{
|
{
|
|
@ -1,8 +1,6 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions.Resolved
|
namespace Geekbot.Interactions.Resolved
|
||||||
{
|
{
|
||||||
public record Message
|
public record Message
|
||||||
{
|
{
|
|
@ -1,7 +1,7 @@
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using Geekbot.Core.Interactions.Request;
|
using Geekbot.Interactions.Request;
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions.Resolved
|
namespace Geekbot.Interactions.Resolved
|
||||||
{
|
{
|
||||||
public record MessageInteraction
|
public record MessageInteraction
|
||||||
{
|
{
|
|
@ -1,4 +1,4 @@
|
||||||
namespace Geekbot.Core.Interactions.Resolved
|
namespace Geekbot.Interactions.Resolved
|
||||||
{
|
{
|
||||||
public enum MessageType
|
public enum MessageType
|
||||||
{
|
{
|
|
@ -1,6 +1,6 @@
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions.Resolved
|
namespace Geekbot.Interactions.Resolved
|
||||||
{
|
{
|
||||||
public struct Reaction
|
public struct Reaction
|
||||||
{
|
{
|
|
@ -1,6 +1,6 @@
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions.Resolved
|
namespace Geekbot.Interactions.Resolved
|
||||||
{
|
{
|
||||||
public record Role
|
public record Role
|
||||||
{
|
{
|
|
@ -1,6 +1,6 @@
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions.Resolved
|
namespace Geekbot.Interactions.Resolved
|
||||||
{
|
{
|
||||||
public record RoleTag
|
public record RoleTag
|
||||||
{
|
{
|
|
@ -1,7 +1,6 @@
|
||||||
using System;
|
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions.Resolved
|
namespace Geekbot.Interactions.Resolved
|
||||||
{
|
{
|
||||||
public record ThreadMetadata
|
public record ThreadMetadata
|
||||||
{
|
{
|
|
@ -1,6 +1,6 @@
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions.Resolved
|
namespace Geekbot.Interactions.Resolved
|
||||||
{
|
{
|
||||||
public class User
|
public class User
|
||||||
{
|
{
|
|
@ -1,6 +1,6 @@
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions.Response
|
namespace Geekbot.Interactions.Response
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interactions--both receiving and responding--are webhooks under the hood. So responding to an Interaction is just like sending a webhook request!
|
/// Interactions--both receiving and responding--are webhooks under the hood. So responding to an Interaction is just like sending a webhook request!
|
|
@ -1,10 +1,8 @@
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using Discord;
|
using Discord;
|
||||||
using Geekbot.Core.Interactions.MessageComponents;
|
using Geekbot.Interactions.MessageComponents;
|
||||||
using Embed = Geekbot.Core.Interactions.Embed.Embed;
|
|
||||||
|
|
||||||
namespace Geekbot.Core.Interactions.Response
|
namespace Geekbot.Interactions.Response
|
||||||
{
|
{
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Not all message fields are currently supported.
|
/// Not all message fields are currently supported.
|
|
@ -1,4 +1,4 @@
|
||||||
namespace Geekbot.Core.Interactions.Response
|
namespace Geekbot.Interactions.Response
|
||||||
{
|
{
|
||||||
/// <see href="https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-type"/>
|
/// <see href="https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-type"/>
|
||||||
public enum InteractionResponseType
|
public enum InteractionResponseType
|
|
@ -1,9 +1,9 @@
|
||||||
using Geekbot.Commands.Karma;
|
using Geekbot.Commands.Karma;
|
||||||
using Geekbot.Core.Database;
|
using Geekbot.Core.Database;
|
||||||
using Geekbot.Core.Interactions;
|
using Geekbot.Interactions;
|
||||||
using Geekbot.Core.Interactions.ApplicationCommand;
|
using Geekbot.Interactions.ApplicationCommand;
|
||||||
using Geekbot.Core.Interactions.Request;
|
using Geekbot.Interactions.Request;
|
||||||
using Geekbot.Core.Interactions.Response;
|
using Geekbot.Interactions.Response;
|
||||||
|
|
||||||
namespace Geekbot.Web.Commands;
|
namespace Geekbot.Web.Commands;
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
using Geekbot.Commands.Karma;
|
using Geekbot.Commands.Karma;
|
||||||
using Geekbot.Core.Database;
|
using Geekbot.Core.Database;
|
||||||
using Geekbot.Core.Interactions;
|
using Geekbot.Interactions;
|
||||||
using Geekbot.Core.Interactions.ApplicationCommand;
|
using Geekbot.Interactions.ApplicationCommand;
|
||||||
using Geekbot.Core.Interactions.Request;
|
using Geekbot.Interactions.Request;
|
||||||
using Geekbot.Core.Interactions.Response;
|
using Geekbot.Interactions.Response;
|
||||||
|
|
||||||
namespace Geekbot.Web.Commands;
|
namespace Geekbot.Web.Commands;
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
using Geekbot.Commands.Karma;
|
using Geekbot.Commands.Karma;
|
||||||
using Geekbot.Core.Database;
|
using Geekbot.Core.Database;
|
||||||
using Geekbot.Core.Interactions;
|
using Geekbot.Interactions;
|
||||||
using Geekbot.Core.Interactions.ApplicationCommand;
|
using Geekbot.Interactions.ApplicationCommand;
|
||||||
using Geekbot.Core.Interactions.Request;
|
using Geekbot.Interactions.Request;
|
||||||
using Geekbot.Core.Interactions.Response;
|
using Geekbot.Interactions.Response;
|
||||||
|
|
||||||
namespace Geekbot.Web.Commands;
|
namespace Geekbot.Web.Commands;
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
using Geekbot.Commands.Karma;
|
using Geekbot.Commands.Karma;
|
||||||
using Geekbot.Core.Database;
|
using Geekbot.Core.Database;
|
||||||
using Geekbot.Core.Interactions;
|
using Geekbot.Interactions;
|
||||||
using Geekbot.Core.Interactions.ApplicationCommand;
|
using Geekbot.Interactions.ApplicationCommand;
|
||||||
using Geekbot.Core.Interactions.Request;
|
using Geekbot.Interactions.Request;
|
||||||
using Geekbot.Core.Interactions.Response;
|
using Geekbot.Interactions.Response;
|
||||||
|
|
||||||
namespace Geekbot.Web.Commands;
|
namespace Geekbot.Web.Commands;
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
using Geekbot.Core.Converters;
|
using Geekbot.Core.Converters;
|
||||||
using Geekbot.Core.Database;
|
using Geekbot.Core.Database;
|
||||||
using Geekbot.Core.Highscores;
|
using Geekbot.Core.Highscores;
|
||||||
using Geekbot.Core.Interactions;
|
using Geekbot.Interactions;
|
||||||
using Geekbot.Core.Interactions.ApplicationCommand;
|
using Geekbot.Interactions.ApplicationCommand;
|
||||||
using Geekbot.Core.Interactions.Request;
|
using Geekbot.Interactions.Request;
|
||||||
using Geekbot.Core.Interactions.Response;
|
using Geekbot.Interactions.Response;
|
||||||
|
|
||||||
namespace Geekbot.Web.Commands;
|
namespace Geekbot.Web.Commands;
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
using Geekbot.Core.Database;
|
using Geekbot.Core.Database;
|
||||||
using Geekbot.Core.Interactions;
|
using Geekbot.Interactions;
|
||||||
using Geekbot.Core.Interactions.ApplicationCommand;
|
using Geekbot.Interactions.ApplicationCommand;
|
||||||
using Geekbot.Core.Interactions.Request;
|
using Geekbot.Interactions.Request;
|
||||||
using Geekbot.Core.Interactions.Response;
|
using Geekbot.Interactions.Response;
|
||||||
using Geekbot.Core.KvInMemoryStore;
|
using Geekbot.Core.KvInMemoryStore;
|
||||||
using Geekbot.Core.RandomNumberGenerator;
|
using Geekbot.Core.RandomNumberGenerator;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
using Geekbot.Core.Interactions;
|
using Geekbot.Interactions;
|
||||||
using Geekbot.Core.Interactions.ApplicationCommand;
|
using Geekbot.Interactions.ApplicationCommand;
|
||||||
using Geekbot.Core.Interactions.Request;
|
using Geekbot.Interactions.Request;
|
||||||
using Geekbot.Core.Interactions.Response;
|
using Geekbot.Interactions.Response;
|
||||||
|
|
||||||
namespace Geekbot.Web.Commands;
|
namespace Geekbot.Web.Commands;
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using Geekbot.Core.GlobalSettings;
|
using Geekbot.Core.GlobalSettings;
|
||||||
using Geekbot.Core.Interactions;
|
using Geekbot.Interactions;
|
||||||
using Geekbot.Core.Interactions.Request;
|
using Geekbot.Interactions.Request;
|
||||||
using Geekbot.Core.Interactions.Response;
|
using Geekbot.Interactions.Response;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Sodium;
|
using Sodium;
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
using Geekbot.Core;
|
using Geekbot.Core;
|
||||||
using Geekbot.Core.GlobalSettings;
|
using Geekbot.Core.GlobalSettings;
|
||||||
using Geekbot.Core.Interactions;
|
using Geekbot.Interactions;
|
||||||
using Geekbot.Core.Interactions.ApplicationCommand;
|
using Geekbot.Interactions.ApplicationCommand;
|
||||||
using Geekbot.Core.Logger;
|
using Geekbot.Core.Logger;
|
||||||
using Geekbot.Web.Controllers.Interactions.Model;
|
using Geekbot.Web.Controllers.Interactions.Model;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using Geekbot.Core.Interactions.ApplicationCommand;
|
using Geekbot.Interactions.ApplicationCommand;
|
||||||
|
|
||||||
namespace Geekbot.Web.Controllers.Interactions.Model;
|
namespace Geekbot.Web.Controllers.Interactions.Model;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using Geekbot.Core.Interactions.Request;
|
using Geekbot.Interactions.Request;
|
||||||
|
|
||||||
namespace Geekbot.Web.Controllers.Interactions.Model;
|
namespace Geekbot.Web.Controllers.Interactions.Model;
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Commands\Commands.csproj" />
|
<ProjectReference Include="..\Commands\Commands.csproj" />
|
||||||
<ProjectReference Include="..\Core\Core.csproj" />
|
<ProjectReference Include="..\Core\Core.csproj" />
|
||||||
|
<ProjectReference Include="..\Interactions\Interactions.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -6,8 +6,8 @@ using Geekbot.Core.Database;
|
||||||
using Geekbot.Core.GlobalSettings;
|
using Geekbot.Core.GlobalSettings;
|
||||||
using Geekbot.Core.GuildSettingsManager;
|
using Geekbot.Core.GuildSettingsManager;
|
||||||
using Geekbot.Core.Highscores;
|
using Geekbot.Core.Highscores;
|
||||||
using Geekbot.Core.Interactions;
|
|
||||||
using Geekbot.Core.Logger;
|
using Geekbot.Core.Logger;
|
||||||
|
using Geekbot.Interactions;
|
||||||
using Geekbot.Web.Logging;
|
using Geekbot.Web.Logging;
|
||||||
|
|
||||||
namespace Geekbot.Web;
|
namespace Geekbot.Web;
|
||||||
|
|
Loading…
Reference in a new issue