(ifcbrk)fix: #1335 Add isMentionable parameter to CreateRoleAsync in non-breaking manner (#1418)

* 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:
Chris Johnston
2019-11-29 18:59:11 -08:00
committed by Christopher F
parent 9ede6b905f
commit 1c63fd479d
4 changed files with 40 additions and 7 deletions

View File

@@ -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;