* Fix #1335 Add isMentionable parameter to CreateRoleAsync in non-breaking manner This PR adds the isMentionable parameter to the CreateRoleAsync method in a way that prevents it from being interface-breaking. This has been done by adding it as an optional parameter at the end of publicly-exposed methods. This parameter determines if the newly created role can be mentioned as it is created. * Overload CreateRoleAsync methods
This commit is contained in:
committed by
Christopher F
parent
9ede6b905f
commit
1c63fd479d
@@ -257,7 +257,7 @@ namespace Discord.Rest
|
||||
//Roles
|
||||
/// <exception cref="ArgumentNullException"><paramref name="name"/> is <c>null</c>.</exception>
|
||||
public static async Task<RestRole> CreateRoleAsync(IGuild guild, BaseDiscordClient client,
|
||||
string name, GuildPermissions? permissions, Color? color, bool isHoisted, RequestOptions options)
|
||||
string name, GuildPermissions? permissions, Color? color, bool isHoisted, bool isMentionable, RequestOptions options)
|
||||
{
|
||||
if (name == null) throw new ArgumentNullException(paramName: nameof(name));
|
||||
|
||||
@@ -270,6 +270,7 @@ namespace Discord.Rest
|
||||
x.Permissions = (permissions ?? role.Permissions);
|
||||
x.Color = (color ?? Color.Default);
|
||||
x.Hoist = isHoisted;
|
||||
x.Mentionable = isMentionable;
|
||||
}, options).ConfigureAwait(false);
|
||||
|
||||
return role;
|
||||
|
||||
Reference in New Issue
Block a user