diff --git a/PluralKit.Bot/Commands/CommandTree.cs b/PluralKit.Bot/Commands/CommandTree.cs index 3c491205..872bc86b 100644 --- a/PluralKit.Bot/Commands/CommandTree.cs +++ b/PluralKit.Bot/Commands/CommandTree.cs @@ -78,7 +78,7 @@ namespace PluralKit.Bot public static Command Export = new Command("export", "export", "Exports system information to a data file"); public static Command Help = new Command("help", "help", "Shows help information about PluralKit"); public static Command Explain = new Command("explain", "explain", "Explains the basics of systems and proxying"); - public static Command Message = new Command("message", "message [delete]", "Looks up a proxied message"); + public static Command Message = new Command("message", "message [delete|author]", "Looks up a proxied message"); public static Command LogChannel = new Command("log channel", "log channel ", "Designates a channel to post proxied messages to"); public static Command LogChannelClear = new Command("log channel", "log channel -clear", "Clears the currently set log channel"); public static Command LogEnable = new Command("log enable", "log enable all| [channel 2] [channel 3...]", "Enables message logging in certain channels"); diff --git a/PluralKit.Bot/Commands/Misc.cs b/PluralKit.Bot/Commands/Misc.cs index 3f75b24f..fda8e14c 100644 --- a/PluralKit.Bot/Commands/Misc.cs +++ b/PluralKit.Bot/Commands/Misc.cs @@ -235,6 +235,16 @@ namespace PluralKit.Bot { await ctx.Rest.DeleteMessage(ctx.Message); return; } + if (ctx.Match("author") || ctx.MatchFlag("author")) + { + var user = await _cache.GetOrFetchUser(_rest, message.Message.Sender); + var eb = new EmbedBuilder() + .Author(new(user != null ? $"{user.Username}#{user.Discriminator}" : $"Deleted user ${message.Message.Sender}", IconUrl: user != null ? user.AvatarUrl() : null)) + .Description(message.Message.Sender.ToString()); + + await ctx.Reply(user != null ? $"{user.Mention()} ({user.Id})" : $"*(deleted user {message.Message.Sender})*", embed: eb.Build()); + return; + } await ctx.Reply(embed: await _embeds.CreateMessageInfoEmbed(message)); }