remove new MatchFlag usage, fix glue gen

This commit is contained in:
dusk 2025-11-23 17:09:22 +00:00
parent a29ed2bda0
commit 74e7af0ee1
No known key found for this signature in database
3 changed files with 10 additions and 10 deletions

View file

@ -281,9 +281,9 @@ public partial class CommandTree
Commands.PermcheckChannel(var param, _) => ctx.Execute<Checks>(PermCheck, m => m.PermCheckChannel(ctx, param.target)), Commands.PermcheckChannel(var param, _) => ctx.Execute<Checks>(PermCheck, m => m.PermCheckChannel(ctx, param.target)),
Commands.PermcheckGuild(var param, _) => ctx.Execute<Checks>(PermCheck, m => m.PermCheckGuild(ctx, param.target)), Commands.PermcheckGuild(var param, _) => ctx.Execute<Checks>(PermCheck, m => m.PermCheckGuild(ctx, param.target)),
Commands.MessageProxyCheck(var param, _) => ctx.Execute<Checks>(ProxyCheck, m => m.MessageProxyCheck(ctx, param.target)), Commands.MessageProxyCheck(var param, _) => ctx.Execute<Checks>(ProxyCheck, m => m.MessageProxyCheck(ctx, param.target)),
Commands.MessageInfo(var param, var flags) => ctx.Execute<ProxiedMessage>(Message, m => m.GetMessage(ctx, param.target.MessageId, flags.GetReplyFormat(), flags.delete, flags.author)), Commands.MessageInfo(var param, var flags) => ctx.Execute<ProxiedMessage>(Message, m => m.GetMessage(ctx, param.target.MessageId, flags.GetReplyFormat(), flags.delete, flags.author, flags.show_embed)),
Commands.MessageAuthor(var param, var flags) => ctx.Execute<ProxiedMessage>(Message, m => m.GetMessage(ctx, param.target.MessageId, flags.GetReplyFormat(), false, true)), Commands.MessageAuthor(var param, var flags) => ctx.Execute<ProxiedMessage>(Message, m => m.GetMessage(ctx, param.target.MessageId, flags.GetReplyFormat(), false, true, flags.show_embed)),
Commands.MessageDelete(var param, var flags) => ctx.Execute<ProxiedMessage>(Message, m => m.GetMessage(ctx, param.target.MessageId, flags.GetReplyFormat(), true, false)), Commands.MessageDelete(var param, var flags) => ctx.Execute<ProxiedMessage>(Message, m => m.GetMessage(ctx, param.target.MessageId, flags.GetReplyFormat(), true, false, flags.show_embed)),
Commands.MessageEditSpecified(var param, var flags) => ctx.Execute<ProxiedMessage>(MessageEdit, m => m.EditMessage(ctx, param.target.MessageId, param.new_content, flags.regex, flags.no_space, flags.append, flags.prepend, flags.clear_embeds, flags.clear_attachments)), Commands.MessageEditSpecified(var param, var flags) => ctx.Execute<ProxiedMessage>(MessageEdit, m => m.EditMessage(ctx, param.target.MessageId, param.new_content, flags.regex, flags.no_space, flags.append, flags.prepend, flags.clear_embeds, flags.clear_attachments)),
Commands.MessageEdit(var param, var flags) => ctx.Execute<ProxiedMessage>(MessageEdit, m => m.EditMessage(ctx, null, param.new_content, flags.regex, flags.no_space, flags.append, flags.prepend, flags.clear_embeds, flags.clear_attachments)), Commands.MessageEdit(var param, var flags) => ctx.Execute<ProxiedMessage>(MessageEdit, m => m.EditMessage(ctx, null, param.new_content, flags.regex, flags.no_space, flags.append, flags.prepend, flags.clear_embeds, flags.clear_attachments)),
Commands.MessageReproxySpecified(var param, _) => ctx.Execute<ProxiedMessage>(MessageReproxy, m => m.ReproxyMessage(ctx, param.msg.MessageId, param.member)), Commands.MessageReproxySpecified(var param, _) => ctx.Execute<ProxiedMessage>(MessageReproxy, m => m.ReproxyMessage(ctx, param.msg.MessageId, param.member)),

View file

@ -320,7 +320,7 @@ public class ProxiedMessage
return lastMessage; return lastMessage;
} }
public async Task GetMessage(Context ctx, ulong? messageId, ReplyFormat format, bool isDelete, bool author) public async Task GetMessage(Context ctx, ulong? messageId, ReplyFormat format, bool isDelete, bool author, bool showEmbed)
{ {
if (messageId == null) if (messageId == null)
{ {
@ -330,7 +330,7 @@ public class ProxiedMessage
var message = await ctx.Repository.GetFullMessage(messageId.Value); var message = await ctx.Repository.GetFullMessage(messageId.Value);
if (message == null) if (message == null)
{ {
await GetCommandMessage(ctx, messageId.Value, isDelete); await GetCommandMessage(ctx, messageId.Value, isDelete, showEmbed);
return; return;
} }
@ -407,7 +407,7 @@ public class ProxiedMessage
if (author) if (author)
{ {
var user = await _rest.GetUser(message.Message.Sender); var user = await _rest.GetUser(message.Message.Sender);
if (ctx.MatchFlag("show-embed", "se")) if (showEmbed)
{ {
var eb = new EmbedBuilder() var eb = new EmbedBuilder()
.Author(new Embed.EmbedAuthor( .Author(new Embed.EmbedAuthor(
@ -427,7 +427,7 @@ public class ProxiedMessage
return; return;
} }
if (ctx.MatchFlag("show-embed", "se")) if (showEmbed)
{ {
await ctx.Reply(embed: await _embeds.CreateMessageInfoEmbed(message, showContent, ctx.Config)); await ctx.Reply(embed: await _embeds.CreateMessageInfoEmbed(message, showContent, ctx.Config));
return; return;
@ -436,7 +436,7 @@ public class ProxiedMessage
await ctx.Reply(components: await _embeds.CreateMessageInfoMessageComponents(message, showContent, ctx.Config)); await ctx.Reply(components: await _embeds.CreateMessageInfoMessageComponents(message, showContent, ctx.Config));
} }
private async Task GetCommandMessage(Context ctx, ulong messageId, bool isDelete) private async Task GetCommandMessage(Context ctx, ulong messageId, bool isDelete, bool showEmbed)
{ {
var msg = await _repo.GetCommandMessage(messageId); var msg = await _repo.GetCommandMessage(messageId);
if (msg == null) if (msg == null)
@ -465,7 +465,7 @@ public class ProxiedMessage
else if (!await ctx.CheckPermissionsInGuildChannel(channel, PermissionSet.ViewChannel)) else if (!await ctx.CheckPermissionsInGuildChannel(channel, PermissionSet.ViewChannel))
showContent = false; showContent = false;
if (ctx.MatchFlag("show-embed", "se")) if (showEmbed)
{ {
await ctx.Reply(embed: await _embeds.CreateCommandMessageInfoEmbed(msg, showContent)); await ctx.Reply(embed: await _embeds.CreateCommandMessageInfoEmbed(msg, showContent));
return; return;

View file

@ -207,7 +207,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
p.IncludeCreated = with_created; p.IncludeCreated = with_created;
p.IncludeAvatar = with_avatar; p.IncludeAvatar = with_avatar;
p.IncludePronouns = with_pronouns; p.IncludePronouns = with_pronouns;
p.IncludeDisplayName = with_displayname; p.IncludeDisplayName = with_display_name;
p.IncludeBirthday = with_birthday; p.IncludeBirthday = with_birthday;
// Always show the sort property (unless short list and already showing something else) // Always show the sort property (unless short list and already showing something else)