GetRoleAsync W (#2989)

This commit is contained in:
Mihail Gribkov
2024-08-29 11:22:58 +03:00
committed by GitHub
parent 2aaa0fd2ff
commit 466b491c3c
5 changed files with 47 additions and 0 deletions

View File

@@ -644,6 +644,13 @@ namespace Discord.Rest
return RestRole.Create(client, guild, model);
}
public static async Task<RestRole> GetRoleAsync(IGuild guild, BaseDiscordClient client, ulong roleId, RequestOptions options)
{
var model = await client.ApiClient.GetRoleAsync(guild.Id, roleId, options).ConfigureAwait(false);
return model is null ? null : RestRole.Create(client, guild, model);
}
#endregion
#region Users