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.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.MessageInfo(var param, var flags) => ctx.Execute<ProxiedMessage>(Message, m => m.GetMessage(ctx, param.target.MessageId, flags.GetReplyFormat(), flags.delete, flags.author)),
Commands.MessageAuthor(var param, var flags) => ctx.Execute<ProxiedMessage>(Message, m => m.GetMessage(ctx, param.target.MessageId, flags.GetReplyFormat(), false, true)),
Commands.MessageDelete(var param, var flags) => ctx.Execute<ProxiedMessage>(Message, m => m.GetMessage(ctx, param.target.MessageId, flags.GetReplyFormat(), true, false)),
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, flags.show_embed)),
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.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)),

View file

@ -320,7 +320,7 @@ public class ProxiedMessage
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)
{
@ -330,7 +330,7 @@ public class ProxiedMessage
var message = await ctx.Repository.GetFullMessage(messageId.Value);
if (message == null)
{
await GetCommandMessage(ctx, messageId.Value, isDelete);
await GetCommandMessage(ctx, messageId.Value, isDelete, showEmbed);
return;
}
@ -407,7 +407,7 @@ public class ProxiedMessage
if (author)
{
var user = await _rest.GetUser(message.Message.Sender);
if (ctx.MatchFlag("show-embed", "se"))
if (showEmbed)
{
var eb = new EmbedBuilder()
.Author(new Embed.EmbedAuthor(
@ -427,7 +427,7 @@ public class ProxiedMessage
return;
}
if (ctx.MatchFlag("show-embed", "se"))
if (showEmbed)
{
await ctx.Reply(embed: await _embeds.CreateMessageInfoEmbed(message, showContent, ctx.Config));
return;
@ -436,7 +436,7 @@ public class ProxiedMessage
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);
if (msg == null)
@ -465,7 +465,7 @@ public class ProxiedMessage
else if (!await ctx.CheckPermissionsInGuildChannel(channel, PermissionSet.ViewChannel))
showContent = false;
if (ctx.MatchFlag("show-embed", "se"))
if (showEmbed)
{
await ctx.Reply(embed: await _embeds.CreateCommandMessageInfoEmbed(msg, showContent));
return;

View file

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