@@ -46,6 +46,11 @@ namespace Discord | |||||
/// </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. | ||||
/// </summary> | /// </summary> | ||||
@@ -68,7 +73,8 @@ namespace Discord | |||||
IsDefaultPermission = IsDefaultPermission, | IsDefaultPermission = IsDefaultPermission, | ||||
IsDMEnabled = IsDMEnabled, | IsDMEnabled = IsDMEnabled, | ||||
DefaultMemberPermissions = DefaultMemberPermissions ?? Optional<GuildPermission>.Unspecified, | DefaultMemberPermissions = DefaultMemberPermissions ?? Optional<GuildPermission>.Unspecified, | ||||
NameLocalizations = NameLocalizations | |||||
NameLocalizations = NameLocalizations, | |||||
IsNsfw = IsNsfw, | |||||
}; | }; | ||||
return props; | return props; | ||||
@@ -123,7 +129,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> | ||||
@@ -133,6 +139,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 MessageCommandBuilder WithNsfw(bool permission) | |||||
{ | |||||
IsNsfw = permission; | |||||
return this; | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// Adds a new entry to the <see cref="NameLocalizations"/> collection. | /// Adds a new entry to the <see cref="NameLocalizations"/> collection. | ||||
/// </summary> | /// </summary> | ||||
@@ -46,6 +46,11 @@ namespace Discord | |||||
/// </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. | ||||
/// </summary> | /// </summary> | ||||
@@ -66,7 +71,8 @@ namespace Discord | |||||
IsDefaultPermission = IsDefaultPermission, | IsDefaultPermission = IsDefaultPermission, | ||||
IsDMEnabled = IsDMEnabled, | IsDMEnabled = IsDMEnabled, | ||||
DefaultMemberPermissions = DefaultMemberPermissions ?? Optional<GuildPermission>.Unspecified, | DefaultMemberPermissions = DefaultMemberPermissions ?? Optional<GuildPermission>.Unspecified, | ||||
NameLocalizations = NameLocalizations | |||||
NameLocalizations = NameLocalizations, | |||||
IsNsfw = IsNsfw, | |||||
}; | }; | ||||
return props; | return props; | ||||
@@ -121,7 +127,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> | ||||
@@ -131,6 +137,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 UserCommandBuilder WithNsfw(bool permission) | |||||
{ | |||||
IsNsfw = permission; | |||||
return this; | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// Adds a new entry to the <see cref="NameLocalizations"/> collection. | /// Adds a new entry to the <see cref="NameLocalizations"/> collection. | ||||
/// </summary> | /// </summary> | ||||
@@ -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> | ||||