|
|
@@ -21,6 +21,8 @@ namespace Discord.Rest |
|
|
|
public DateTimeOffset CreatedAt => SnowflakeUtils.FromSnowflake(Id); |
|
|
|
/// <inheritdoc /> |
|
|
|
public string IconUrl => CDN.GetGuildIconUrl(Id, _iconId); |
|
|
|
/// <inheritdoc /> |
|
|
|
public GuildFeatures Features { get; private set; } |
|
|
|
|
|
|
|
internal RestUserGuild(BaseDiscordClient discord, ulong id) |
|
|
|
: base(discord, id) |
|
|
@@ -39,12 +41,20 @@ namespace Discord.Rest |
|
|
|
IsOwner = model.Owner; |
|
|
|
Name = model.Name; |
|
|
|
Permissions = new GuildPermissions(model.Permissions); |
|
|
|
Features = model.Features; |
|
|
|
} |
|
|
|
|
|
|
|
public async Task LeaveAsync(RequestOptions options = null) |
|
|
|
{ |
|
|
|
await Discord.ApiClient.LeaveGuildAsync(Id, options).ConfigureAwait(false); |
|
|
|
} |
|
|
|
|
|
|
|
public async Task<RestGuildUser> GetCurrentUserGuildMemberAsync(RequestOptions options = null) |
|
|
|
{ |
|
|
|
var user = await Discord.ApiClient.GetCurrentUserGuildMember(Id, options); |
|
|
|
return RestGuildUser.Create(Discord, null, user, Id); |
|
|
|
} |
|
|
|
|
|
|
|
/// <inheritdoc /> |
|
|
|
public async Task DeleteAsync(RequestOptions options = null) |
|
|
|
{ |
|
|
|