コード例 #1
0
 internal CachedOverwrite(DiscordClient client, OverwriteModel model, CachedGuildChannel channel) : base(client, model.Id)
 {
     Channel     = channel;
     TargetId    = model.Id;
     Permissions = (model.Allow, model.Deny);
     TargetType  = model.Type;
 }
コード例 #2
0
 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;
 }
コード例 #3
0
 internal RestOverwrite(RestDiscordClient client, Snowflake channelId, OverwriteModel model) : base(client)
 {
     ChannelId = channelId;
     Channel   = RestFetchable.Create(this, (@this, options) =>
                                      @this.Client.GetChannelAsync <RestGuildChannel>(@this.ChannelId, options));
     TargetId    = model.Id;
     Permissions = (model.Allow, model.Deny);
     TargetType  = model.Type;
 }
コード例 #4
0
        public LocalOverwrite(IRole target, OverwritePermissions permissions)
        {
            if (target == null)
            {
                throw new ArgumentNullException(nameof(target));
            }

            TargetId    = target.Id;
            TargetType  = OverwriteTargetType.Role;
            Permissions = permissions;
        }
コード例 #5
0
 public LocalOverwrite(Snowflake targetId, OverwriteTargetType targetType, OverwritePermissions permissions)
 {
     TargetId    = targetId;
     TargetType  = targetType;
     Permissions = permissions;
 }