mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-12 02:08:27 -04:00
add: Added .quteedit command
add: Added an edit button to .quoteshow and .exprshow commands that opens a modal which lets you edit the quote or expr in question
This commit is contained in:
@@ -34,11 +34,11 @@ public partial class ResponseBuilder
|
||||
if (_paginationBuilder.AddPaginatedFooter)
|
||||
embed.AddPaginatedFooter(currentPage, lastPage);
|
||||
|
||||
NadekoInteraction? maybeInter = null;
|
||||
NadekoInteractionBase? maybeInter = null;
|
||||
|
||||
var model = await _builder.BuildAsync(ephemeral);
|
||||
|
||||
async Task<(NadekoButtonInteraction left, NadekoInteraction? extra, NadekoButtonInteraction right)>
|
||||
async Task<(NadekoButtonInteractionHandler left, NadekoInteractionBase? extra, NadekoButtonInteractionHandler right)>
|
||||
GetInteractions()
|
||||
{
|
||||
var leftButton = new ButtonBuilder()
|
||||
@@ -47,7 +47,7 @@ public partial class ResponseBuilder
|
||||
.WithEmote(InteractionHelpers.ArrowLeft)
|
||||
.WithDisabled(lastPage == 0 || currentPage <= 0);
|
||||
|
||||
var leftBtnInter = new NadekoButtonInteraction(_client,
|
||||
var leftBtnInter = new NadekoButtonInteractionHandler(_client,
|
||||
model.User?.Id ?? 0,
|
||||
leftButton,
|
||||
(smc) =>
|
||||
@@ -80,7 +80,7 @@ public partial class ResponseBuilder
|
||||
.WithEmote(InteractionHelpers.ArrowRight)
|
||||
.WithDisabled(lastPage == 0 || currentPage >= lastPage);
|
||||
|
||||
var rightBtnInter = new NadekoButtonInteraction(_client,
|
||||
var rightBtnInter = new NadekoButtonInteractionHandler(_client,
|
||||
model.User?.Id ?? 0,
|
||||
rightButton,
|
||||
(smc) =>
|
||||
|
@@ -19,7 +19,7 @@ public sealed partial class ResponseBuilder
|
||||
private readonly IBotStrings _bs;
|
||||
private readonly BotConfigService _bcs;
|
||||
private EmbedBuilder? embedBuilder;
|
||||
private NadekoInteraction? inter;
|
||||
private NadekoInteractionBase? inter;
|
||||
private Stream? fileStream;
|
||||
private string? fileName;
|
||||
private EmbedColor color = EmbedColor.Ok;
|
||||
@@ -340,7 +340,7 @@ public sealed partial class ResponseBuilder
|
||||
return this;
|
||||
}
|
||||
|
||||
public ResponseBuilder Interaction(NadekoInteraction? interaction)
|
||||
public ResponseBuilder Interaction(NadekoInteractionBase? interaction)
|
||||
{
|
||||
inter = interaction;
|
||||
return this;
|
||||
@@ -395,7 +395,7 @@ public sealed class SourcedPaginatedResponseBuilder<T> : PaginatedResponseBuilde
|
||||
return Task.FromResult<IReadOnlyCollection<T>>(ReadOnlyCollection<T>.Empty);
|
||||
};
|
||||
|
||||
public Func<int, Task<NadekoInteraction>>? InteractionFunc { get; private set; }
|
||||
public Func<int, Task<NadekoInteractionBase>>? InteractionFunc { get; private set; }
|
||||
|
||||
public int? Elems { get; private set; } = 1;
|
||||
public int ItemsPerPage { get; private set; } = 9;
|
||||
@@ -478,13 +478,13 @@ public sealed class SourcedPaginatedResponseBuilder<T> : PaginatedResponseBuilde
|
||||
return paginationSender.SendAsync(IsEphemeral);
|
||||
}
|
||||
|
||||
public SourcedPaginatedResponseBuilder<T> Interaction(Func<int, Task<NadekoInteraction>> func)
|
||||
public SourcedPaginatedResponseBuilder<T> Interaction(Func<int, Task<NadekoInteractionBase>> func)
|
||||
{
|
||||
InteractionFunc = func; //async (i) => await func(i);
|
||||
return this;
|
||||
}
|
||||
|
||||
public SourcedPaginatedResponseBuilder<T> Interaction(NadekoInteraction inter)
|
||||
public SourcedPaginatedResponseBuilder<T> Interaction(NadekoInteractionBase inter)
|
||||
{
|
||||
InteractionFunc = _ => Task.FromResult(inter);
|
||||
return this;
|
||||
|
@@ -8,5 +8,5 @@
|
||||
public required AllowedMentions SanitizeMentions { get; set; }
|
||||
public IUser? User { get; set; }
|
||||
public bool Ephemeral { get; set; }
|
||||
public NadekoInteraction? Interaction { get; set; }
|
||||
public NadekoInteractionBase? Interaction { get; set; }
|
||||
}
|
Reference in New Issue
Block a user