mirror of
https://github.com/RPCS3/discord-bot.git
synced 2024-11-23 10:19:39 +00:00
namespace button interactions for future
This commit is contained in:
parent
e8b716e6d3
commit
eef13f9a4a
@ -51,12 +51,12 @@ namespace CompatBot.Commands
|
||||
askForId = false;
|
||||
var messageBuilder = new DiscordMessageBuilder().WithContent("Please select correct product code from the list or specify your own:");
|
||||
foreach (var row in compatResult)
|
||||
messageBuilder.AddComponents(row.Select(c => new DiscordButtonComponent(ButtonStyle.Secondary, c, c)));
|
||||
messageBuilder.AddComponents(row.Select(c => new DiscordButtonComponent(ButtonStyle.Secondary, "psn:check:updates:" + c, c)));
|
||||
var interactivity = ctx.Client.GetInteractivity();
|
||||
var botMsg = await ctx.Channel.SendMessageAsync(messageBuilder).ConfigureAwait(false);
|
||||
var reaction = await interactivity.WaitForMessageOrButtonAsync(botMsg, ctx.User, TimeSpan.FromMinutes(1)).ConfigureAwait(false);
|
||||
if (reaction.reaction?.Id is {Length: 9} selectedId)
|
||||
id = selectedId;
|
||||
if (reaction.reaction?.Id is {Length: >=9} selectedId)
|
||||
id = selectedId[^9..];
|
||||
else if (reaction.text?.Content is {Length: >= 9} customId)
|
||||
{
|
||||
if (customId.StartsWith(Config.CommandPrefix) || customId.StartsWith(Config.AutoRemoveCommandPrefix))
|
||||
|
@ -287,6 +287,8 @@ namespace CompatBot
|
||||
client.GuildMemberUpdated += UsernameZalgoMonitor.OnMemberUpdated;
|
||||
client.GuildMemberUpdated += UsernameValidationMonitor.OnMemberUpdated;
|
||||
|
||||
//client.ComponentInteractionCreated += ToggleBadUpdate;
|
||||
|
||||
Watchdog.DisconnectTimestamps.Enqueue(DateTime.UtcNow);
|
||||
|
||||
try
|
||||
|
Loading…
Reference in New Issue
Block a user