@@ -29,8 +29,12 @@ namespace Discord | |||||
/// <summary> Modifies this user's properties in this guild. </summary> | /// <summary> Modifies this user's properties in this guild. </summary> | ||||
Task ModifyAsync(Action<GuildUserProperties> func, RequestOptions options = null); | Task ModifyAsync(Action<GuildUserProperties> func, RequestOptions options = null); | ||||
/// <summary> Adds a role to this user in this guild. </summary> | |||||
Task AddRoleAsync(IRole role, RequestOptions options = null); | |||||
/// <summary> Adds roles to this user in this guild. </summary> | /// <summary> Adds roles to this user in this guild. </summary> | ||||
Task AddRolesAsync(IEnumerable<IRole> roles, RequestOptions options = null); | Task AddRolesAsync(IEnumerable<IRole> roles, RequestOptions options = null); | ||||
/// <summary> Removes a role from this user in this guild. </summary> | |||||
Task RemoveRoleAsync(IRole role, RequestOptions options = null); | |||||
/// <summary> Removes roles from this user in this guild. </summary> | /// <summary> Removes roles from this user in this guild. </summary> | ||||
Task RemoveRolesAsync(IEnumerable<IRole> roles, RequestOptions options = null); | Task RemoveRolesAsync(IEnumerable<IRole> roles, RequestOptions options = null); | ||||
} | } | ||||
@@ -82,14 +82,20 @@ namespace Discord.Rest | |||||
else if (args.RoleIds.IsSpecified) | else if (args.RoleIds.IsSpecified) | ||||
UpdateRoles(args.RoleIds.Value.ToArray()); | UpdateRoles(args.RoleIds.Value.ToArray()); | ||||
} | } | ||||
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 /> | /// <inheritdoc /> | ||||
public Task AddRolesAsync(IEnumerable<IRole> roles, RequestOptions options = null) | public Task AddRolesAsync(IEnumerable<IRole> roles, RequestOptions options = null) | ||||
=> UserHelper.AddRolesAsync(this, Discord, roles, options); | => UserHelper.AddRolesAsync(this, Discord, roles, options); | ||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public Task RemoveRoleAsync(IRole role, RequestOptions options = null) | |||||
=> RemoveRolesAsync(new[] { role }, options); | |||||
/// <inheritdoc /> | |||||
public Task RemoveRolesAsync(IEnumerable<IRole> roles, RequestOptions options = null) | public Task RemoveRolesAsync(IEnumerable<IRole> roles, RequestOptions options = null) | ||||
=> UserHelper.RemoveRolesAsync(this, Discord, roles, options); | => UserHelper.RemoveRolesAsync(this, Discord, roles, options); | ||||
public Task KickAsync(RequestOptions options = null) | |||||
=> UserHelper.KickAsync(this, Discord, options); | |||||
public ChannelPermissions GetPermissions(IGuildChannel channel) | public ChannelPermissions GetPermissions(IGuildChannel channel) | ||||
{ | { | ||||
@@ -108,9 +108,15 @@ namespace Discord.WebSocket | |||||
public Task KickAsync(RequestOptions options = null) | public Task KickAsync(RequestOptions options = null) | ||||
=> UserHelper.KickAsync(this, Discord, options); | => UserHelper.KickAsync(this, Discord, options); | ||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public Task AddRoleAsync(IRole role, RequestOptions options = null) | |||||
=> AddRolesAsync(new[] { role }, options); | |||||
/// <inheritdoc /> | |||||
public Task AddRolesAsync(IEnumerable<IRole> roles, RequestOptions options = null) | public Task AddRolesAsync(IEnumerable<IRole> roles, RequestOptions options = null) | ||||
=> UserHelper.AddRolesAsync(this, Discord, roles, options); | => UserHelper.AddRolesAsync(this, Discord, roles, options); | ||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public Task RemoveRoleAsync(IRole role, RequestOptions options = null) | |||||
=> RemoveRolesAsync(new[] { role }, options); | |||||
/// <inheritdoc /> | |||||
public Task RemoveRolesAsync(IEnumerable<IRole> roles, RequestOptions options = null) | public Task RemoveRolesAsync(IEnumerable<IRole> roles, RequestOptions options = null) | ||||
=> UserHelper.RemoveRolesAsync(this, Discord, roles, options); | => UserHelper.RemoveRolesAsync(this, Discord, roles, options); | ||||