@@ -84,6 +84,11 @@ namespace Discord
/// Gets or sets whether or not this command can be used in DMs.
/// Gets or sets whether or not this command can be used in DMs.
/// </summary>
/// </summary>
public bool IsDMEnabled { get; set; } = true;
public bool IsDMEnabled { get; set; } = true;
/// <summary>
/// Gets or sets whether or not this command is age restricted.
/// </summary>
public bool IsNsfw { get; set; } = false;
/// <summary>
/// <summary>
/// Gets or sets the default permission required to use this slash command.
/// Gets or sets the default permission required to use this slash command.
@@ -110,7 +115,8 @@ namespace Discord
NameLocalizations = _nameLocalizations,
NameLocalizations = _nameLocalizations,
DescriptionLocalizations = _descriptionLocalizations,
DescriptionLocalizations = _descriptionLocalizations,
IsDMEnabled = IsDMEnabled,
IsDMEnabled = IsDMEnabled,
DefaultMemberPermissions = DefaultMemberPermissions ?? Optional<GuildPermission>.Unspecified
DefaultMemberPermissions = DefaultMemberPermissions ?? Optional<GuildPermission>.Unspecified,
IsNsfw = IsNsfw,
};
};
if (Options != null && Options.Any())
if (Options != null && Options.Any())
@@ -161,7 +167,7 @@ namespace Discord
}
}
/// <summary>
/// <summary>
/// Sets whether or not this command can be used in dms
/// Sets whether or not this command can be used in dms.
/// </summary>
/// </summary>
/// <param name="permission"><see langword="true"/> if the command is available in dms, otherwise <see langword="false"/>.</param>
/// <param name="permission"><see langword="true"/> if the command is available in dms, otherwise <see langword="false"/>.</param>
/// <returns>The current builder.</returns>
/// <returns>The current builder.</returns>
@@ -171,6 +177,17 @@ namespace Discord
return this;
return this;
}
}
/// <summary>
/// Sets whether or not this command is age restricted.
/// </summary>
/// <param name="permission"><see langword="true"/> if the command is age restricted, otherwise <see langword="false"/>.</param>
/// <returns>The current builder.</returns>
public SlashCommandBuilder WithNsfw(bool permission)
{
IsNsfw = permission;
return this;
}
/// <summary>
/// <summary>
/// Sets the default member permissions required to use this application command.
/// Sets the default member permissions required to use this application command.
/// </summary>
/// </summary>