You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

EnabledInDmAttribute.cs 901 B

12345678910111213141516171819202122232425
  1. using System;
  2. namespace Discord.Interactions
  3. {
  4. /// <summary>
  5. /// Sets the <see cref="IApplicationCommandInfo.IsEnabledInDm"/> property of an application command or module.
  6. /// </summary>
  7. [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
  8. public class EnabledInDmAttribute : Attribute
  9. {
  10. /// <summary>
  11. /// Gets whether or not this command can be used in DMs.
  12. /// </summary>
  13. public bool IsEnabled { get; }
  14. /// <summary>
  15. /// Sets the <see cref="IApplicationCommandInfo.IsEnabledInDm"/> property of an application command or module.
  16. /// </summary>
  17. /// <param name="isEnabled">Whether or not this command can be used in DMs.</param>
  18. public EnabledInDmAttribute(bool isEnabled)
  19. {
  20. IsEnabled = isEnabled;
  21. }
  22. }
  23. }