Skip to content

Commit

Permalink
Display Names for context menu commands
Browse files Browse the repository at this point in the history
  • Loading branch information
OoLunar committed Nov 3, 2024
1 parent a1d1d80 commit fb734a7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/Commands/Common/AvatarCommand.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.ComponentModel;
using System.Threading.Tasks;
using DSharpPlus;
using DSharpPlus.Commands;
Expand Down Expand Up @@ -31,7 +32,7 @@ public sealed class AvatarCommand
/// <param name="imageFormat">The format of the image to fetch. Valid options include: png, gif, jpeg, webp, or auto. Auto will display the gif when available and fallback to png when it's not.</param>
/// <param name="imageDimensions">A number between 16 and 4096 that represents the dimensions of the image to fetch. If no dimensions are provided, the command will default to 1024. The dimensions must be a power of two.</param>
/// <returns>Nothing</returns>
[Command("user"), DefaultGroupCommand, SlashCommandTypes(DiscordApplicationCommandType.SlashCommand, DiscordApplicationCommandType.UserContextMenu)]
[Command("user"), DisplayName("Avatar"), DefaultGroupCommand, SlashCommandTypes(DiscordApplicationCommandType.SlashCommand, DiscordApplicationCommandType.UserContextMenu)]
public ValueTask UserAsync(CommandContext context, DiscordUser? user = null, ImageFormat imageFormat = ImageFormat.Auto, ushort imageDimensions = 0)
{
user ??= context.User;
Expand Down
3 changes: 2 additions & 1 deletion src/Commands/Common/InfoCommand/InfoCommand.User.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.Linq;
using System.Threading.Tasks;
Expand All @@ -19,7 +20,7 @@ public sealed partial class InfoCommand
/// Sends information about the provided user.
/// </summary>
/// <param name="user">Which user to get information about. Leave empty to get information about yourself.</param>
[Command("user"), TextAlias("member"), SlashCommandTypes(DiscordApplicationCommandType.SlashCommand, DiscordApplicationCommandType.UserContextMenu)]
[Command("user"), TextAlias("member"), DisplayName("Info User"), SlashCommandTypes(DiscordApplicationCommandType.SlashCommand, DiscordApplicationCommandType.UserContextMenu)]
public static async Task UserInfoAsync(CommandContext context, DiscordUser? user = null)
{
user ??= context.User;
Expand Down
3 changes: 2 additions & 1 deletion src/Commands/Common/RawCommand.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.ComponentModel;
using System.IO;
using System.Text;
using System.Threading.Tasks;
Expand All @@ -23,7 +24,7 @@ public static class RawCommand
/// </summary>
/// <param name="message">The message to get the raw content of.</param>
/// <param name="jsonfied">Whether to return the raw content as JSON.</param>
[Command("raw"), TextAlias("print"), SlashCommandTypes(DiscordApplicationCommandType.SlashCommand, DiscordApplicationCommandType.MessageContextMenu), RequirePermissions(DiscordPermissions.ReadMessageHistory | DiscordPermissions.EmbedLinks, DiscordPermissions.None)]
[Command("raw"), TextAlias("print"), DisplayName("Raw"), SlashCommandTypes(DiscordApplicationCommandType.SlashCommand, DiscordApplicationCommandType.MessageContextMenu), RequirePermissions(DiscordPermissions.ReadMessageHistory | DiscordPermissions.EmbedLinks, DiscordPermissions.None)]
public static ValueTask ExecuteAsync(CommandContext context, DiscordMessage? message = null, bool jsonfied = false)
{
if (context is TextCommandContext textContext && message is null)
Expand Down
3 changes: 2 additions & 1 deletion src/Commands/Common/RetryCommand.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.ComponentModel;
using System.Linq;
using System.Threading.Tasks;
using DSharpPlus.Commands;
Expand All @@ -23,7 +24,7 @@ public static class RetryCommand
/// </remarks>
/// <param name="message">The message to re-run.</param>
/// <param name="asWho">Who to run the command as.</param>
[Command("retry"), TextAlias("rerun"), SlashCommandTypes(DiscordApplicationCommandType.SlashCommand, DiscordApplicationCommandType.MessageContextMenu)]
[Command("retry"), TextAlias("rerun"), DisplayName("Retry"), SlashCommandTypes(DiscordApplicationCommandType.SlashCommand, DiscordApplicationCommandType.MessageContextMenu)]
public static async ValueTask RetryAsync(CommandContext context, DiscordMessage message, DiscordUser? asWho = null)
{
if (context is SlashCommandContext slashCommandContext)
Expand Down

0 comments on commit fb734a7

Please sign in to comment.