Ejemplo n.º 1
0
        /// <summary> Edits the provided server, changing only non-null attributes. </summary>
        public async Task EditServer(Server server, string name = null, Region region = null, ImageType iconType = ImageType.Png, byte[] icon = null)
        {
            if (server == null)
            {
                throw new ArgumentNullException(nameof(server));
            }
            CheckReady();

            var response = await _api.EditServer(server.Id, name : name ?? server.Name, region : region.Value, iconType : iconType, icon : icon).ConfigureAwait(false);

            server.Update(response);
        }
Ejemplo n.º 2
0
 internal void Update(InviteReference model)
 {
     if (model.Guild != null && _generatedServer != null)
     {
         _generatedServer.Update(model.Guild);
     }
     if (model.Inviter != null && _generatedInviter != null)
     {
         _generatedInviter.Update(model.Inviter);
     }
     if (model.Channel != null && _generatedChannel != null)
     {
         _generatedChannel.Update(model.Channel);
     }
 }