internal RestBan(RestDiscordClient client, BanModel model, Snowflake guildId) : base(client) { GuildId = guildId; Guild = new RestDownloadable <RestGuild>(options => Client.GetGuildAsync(guildId, options)); User = new RestUser(client, model.User); Reason = model.Reason; }
internal RestApplication(RestDiscordClient client, ApplicationModel model) : base(client, model.Id) { Name = model.Name; IconHash = model.Icon; Description = model.Description; RpcOrigins = RpcOrigins != null ? model.RpcOrigins.ToImmutableArray() : ImmutableArray <string> .Empty; IsBotPublic = model.BotPublic; BotRequiresCodeGrant = model.BotRequireCodeGrant; if (model.Owner != null) { Owner = new RestUser(Client, model.Owner); } Summary = model.Summary; VerifyKey = model.VerifyKey; GuildId = model.GuildId; Guild = new RestDownloadable <RestGuild>(options => Client.GetGuildAsync(GuildId, options)); PrimarySkuId = model.PrimarySkuId; SlugUrl = model.Slug; CoverImageHash = model.CoverImage; }
internal RestWebhook(RestDiscordClient client, WebhookModel model) : base(client, model.Id) { Token = model.Token; GuildId = model.GuildId; Guild = new RestDownloadable <RestGuild>(options => Client.GetGuildAsync(GuildId, options)); Channel = new RestDownloadable <RestTextChannel>(async options => await client.GetChannelAsync(ChannelId, options).ConfigureAwait(false) as RestTextChannel); }
internal RestOverwrite(RestDiscordClient client, OverwriteModel model, Snowflake channelId) : base(client) { ChannelId = channelId; Channel = new RestDownloadable <RestGuildChannel>(options => Client.GetChannelAsync <RestGuildChannel>(channelId, options)); TargetId = model.Id; Permissions = (model.Allow, model.Deny); TargetType = model.Type; }
internal RestGuildEmoji(RestDiscordClient client, EmojiModel model, ulong guildId) : base(client, model.Id.Value) { GuildId = guildId; Guild = new RestDownloadable <RestGuild>(options => Client.GetGuildAsync(GuildId, options)); RequiresColons = model.RequireColons; IsManaged = model.Managed; IsAnimated = model.Animated; Update(model); }
internal RestMember(RestDiscordClient client, MemberModel model, Snowflake guildId) : base(client, model.User) { GuildId = guildId; Guild = new RestDownloadable <RestGuild>(options => Client.GetGuildAsync(GuildId, options)); JoinedAt = model.JoinedAt; IsMuted = model.Mute; IsDeafened = model.Deaf; Update(model); }
private RestWebhookClient(ILogger logger, IJsonSerializer serializer) { Webhook = new RestDownloadable <RestWebhook>(options => _client.GetWebhookWithTokenAsync(Id, Token, options)); _client = RestDiscordClient.CreateWithoutAuthorization(logger, serializer); }
internal RestWidget(RestDiscordClient client, WidgetModel model, Snowflake guildId) : base(client) { GuildId = guildId; Guild = new RestDownloadable <RestGuild>(options => Client.GetGuildAsync(GuildId, options)); Update(model); }
internal RestGuildChannel(RestDiscordClient client, ChannelModel model) : base(client, model) { GuildId = model.GuildId.Value; Guild = new RestDownloadable <RestGuild>(options => Client.GetGuildAsync(GuildId, options)); }
internal RestRole(RestDiscordClient client, RoleModel model, ulong guildId) : base(client, model.Id) { GuildId = guildId; Guild = new RestDownloadable <RestGuild>(options => Client.GetGuildAsync(GuildId, options)); Update(model); }
internal RestGuildVoiceRegion(RestDiscordClient client, VoiceRegionModel model, Snowflake guildId) : base(client, model) { GuildId = guildId; Guild = new RestDownloadable <RestGuild>(options => Client.GetGuildAsync(GuildId, options)); }