Exemplo n.º 1
0
 public static void ModifyGuildChannel(string chnId, ModifyChannel newChn)
 {
     try
     {
         IChannelService channelservice = AuthenticatedRestFactory.GetChannelService();
         channelservice.ModifyChannel(chnId, newChn).Wait();
     }
     catch (Exception exception)
     {
         App.NavigateToBugReport(exception);
     }
 }
Exemplo n.º 2
0
        private void SaveChannelSettings(object sender, RoutedEventArgs e)
        {
            ModifyChannel modifychannel = new ModifyChannel()
            {
                Name                 = ChannelName.Text,
                Topic                = ChannelTopic.Text,
                Bitrate              = 64000,
                Position             = LocalState.Guilds[App.CurrentGuildId].channels[channelId].raw.Position,
                NSFW                 = NsfwSwitch.IsOn,
                PermissionOverwrites = LocalState.Guilds[App.CurrentGuildId].channels[channelId].raw.PermissionOverwrites,
                ParentId             = LocalState.Guilds[App.CurrentGuildId].channels[channelId].raw.ParentId
            };

            Task.Run(async() =>
            {
                await RESTCalls.ModifyGuildChannel(channelId, modifychannel);
            });
            CloseButton_Click(null, null);
        }
Exemplo n.º 3
0
        /// <inheritdoc />
        public virtual Task ModifyChannel(string channelId, ModifyChannel modifyChannel)
        {
            var arguments = new object[] { channelId, modifyChannel };

            return((Task)methodImpls["ModifyChannel"](Client, arguments));
        }
Exemplo n.º 4
0
        internal async Task <Channel> ModifyChannelInternalAsync(string token, ulong channelId, ModifyChannel changes)
        {
            try
            {
                var response = await SendAsync(new ModifyChannelRequest(token, channelId, changes));

                return(response.GetBodyAsType <Channel>());
            }
            catch (HttpException ex) when(ex.StatusCode == HttpStatusCode.Unauthorized)
            {
                return(null);
            }
        }