bind interaction to module
This commit is contained in:
@@ -54,6 +54,12 @@ internal class DiscordBot : IHostedService
|
|||||||
await interactionModule.AddModuleAsync(typeof(MareModule), _services).ConfigureAwait(false);
|
await interactionModule.AddModuleAsync(typeof(MareModule), _services).ConfigureAwait(false);
|
||||||
await interactionModule.RegisterCommandsToGuildAsync(guild.Id, true).ConfigureAwait(false);
|
await interactionModule.RegisterCommandsToGuildAsync(guild.Id, true).ConfigureAwait(false);
|
||||||
|
|
||||||
|
_discordClient.InteractionCreated += async (x) =>
|
||||||
|
{
|
||||||
|
var ctx = new SocketInteractionContext(_discordClient, x);
|
||||||
|
await interactionModule.ExecuteCommandAsync(ctx, _services);
|
||||||
|
};
|
||||||
|
|
||||||
_ = RemoveUsersNotInVanityRole();
|
_ = RemoveUsersNotInVanityRole();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ using System.Threading;
|
|||||||
|
|
||||||
namespace MareSynchronosServices.Discord;
|
namespace MareSynchronosServices.Discord;
|
||||||
|
|
||||||
internal class DiscordBotServices
|
public class DiscordBotServices
|
||||||
{
|
{
|
||||||
public readonly ConcurrentQueue<SocketSlashCommand> verificationQueue = new();
|
public readonly ConcurrentQueue<SocketSlashCommand> verificationQueue = new();
|
||||||
public ConcurrentDictionary<ulong, DateTime> LastVanityChange = new();
|
public ConcurrentDictionary<ulong, DateTime> LastVanityChange = new();
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ using MareSynchronosServices.Identity;
|
|||||||
|
|
||||||
namespace MareSynchronosServices.Discord;
|
namespace MareSynchronosServices.Discord;
|
||||||
|
|
||||||
internal class LodestoneModal : IModal
|
public class LodestoneModal : IModal
|
||||||
{
|
{
|
||||||
public string Title => "Verify with Lodestone";
|
public string Title => "Verify with Lodestone";
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ internal class LodestoneModal : IModal
|
|||||||
public string LodestoneUrl { get; set; }
|
public string LodestoneUrl { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class MareModule : InteractionModuleBase
|
public class MareModule : InteractionModuleBase
|
||||||
{
|
{
|
||||||
private readonly IServiceProvider _services;
|
private readonly IServiceProvider _services;
|
||||||
private readonly DiscordBotServices _botServices;
|
private readonly DiscordBotServices _botServices;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace MareSynchronosServices.Identity;
|
namespace MareSynchronosServices.Identity;
|
||||||
|
|
||||||
internal class IdentityHandler
|
public class IdentityHandler
|
||||||
{
|
{
|
||||||
private readonly ConcurrentDictionary<string, ServerIdentity> cachedIdentities = new();
|
private readonly ConcurrentDictionary<string, ServerIdentity> cachedIdentities = new();
|
||||||
private readonly ConcurrentDictionary<string, ConcurrentQueue<IdentChange>> identChanges = new();
|
private readonly ConcurrentDictionary<string, ConcurrentQueue<IdentChange>> identChanges = new();
|
||||||
|
|||||||
Reference in New Issue
Block a user