GuildUserExtensions removed in favour of atomic role add/remove endpoints (#540)

* Removed GuildUserExtensions and moved the methods to IGuildUser and implementations

* Made changes per fox's suggestion: Change->Modify. New Modify overload.

* Oops

* Per Volt: reimplemented new endpoints

* Fixing broken docstrings

* I forgot that docstrings are XML

* Implemented atomic add/remove role endpoints

* Removed  so people aren't irked

* Added single-item role add/remove methods
This commit is contained in:
Mateusz Brawański
2017-03-18 12:54:49 +01:00
committed by RogueException
parent 11ba30c6fa
commit efbd3cb681
7 changed files with 70 additions and 31 deletions

View File

@@ -109,6 +109,18 @@ namespace Discord.WebSocket
=> UserHelper.ModifyAsync(this, Discord, func, options);
public Task KickAsync(RequestOptions options = null)
=> UserHelper.KickAsync(this, Discord, options);
/// <inheritdoc />
public Task AddRoleAsync(IRole role, RequestOptions options = null)
=> AddRolesAsync(new[] { role }, options);
/// <inheritdoc />
public Task AddRolesAsync(IEnumerable<IRole> roles, RequestOptions options = null)
=> UserHelper.AddRolesAsync(this, Discord, roles, options);
/// <inheritdoc />
public Task RemoveRoleAsync(IRole role, RequestOptions options = null)
=> RemoveRolesAsync(new[] { role }, options);
/// <inheritdoc />
public Task RemoveRolesAsync(IEnumerable<IRole> roles, RequestOptions options = null)
=> UserHelper.RemoveRolesAsync(this, Discord, roles, options);
public ChannelPermissions GetPermissions(IGuildChannel channel)
=> new ChannelPermissions(Permissions.ResolveChannel(Guild, this, channel, GuildPermissions.RawValue));