From 09533848604ac821e628dc4b425695c287eca900 Mon Sep 17 00:00:00 2001 From: MrDave1999 Date: Wed, 15 Jul 2026 19:03:55 -0500 Subject: [PATCH] feat: add CommandDefinition.GetTag helper --- .../Core/CommandDefinition.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/SampSharp.OpenMp.Entities.Commands/Core/CommandDefinition.cs b/src/SampSharp.OpenMp.Entities.Commands/Core/CommandDefinition.cs index 1211ec4e..69bea5a3 100644 --- a/src/SampSharp.OpenMp.Entities.Commands/Core/CommandDefinition.cs +++ b/src/SampSharp.OpenMp.Entities.Commands/Core/CommandDefinition.cs @@ -88,4 +88,16 @@ public CommandDefinition(string name, CommandGroup? group, MethodInfo method, Pa /// Custom metadata tags attached to this overload. public IReadOnlyDictionary Tags => _tags; + + /// + /// Gets the value of the specified command tag, or + /// if the tag is not present. + /// + public string? GetTag(string key) + { + ArgumentException.ThrowIfNullOrEmpty(key); + return _tags.TryGetValue(key, out var value) + ? value + : null; + } }