public static void ModifyGuildChannel(string chnId, ModifyChannel newChn) { try { IChannelService channelservice = AuthenticatedRestFactory.GetChannelService(); channelservice.ModifyChannel(chnId, newChn).Wait(); } catch (Exception exception) { App.NavigateToBugReport(exception); } }
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); }
/// <inheritdoc /> public virtual Task ModifyChannel(string channelId, ModifyChannel modifyChannel) { var arguments = new object[] { channelId, modifyChannel }; return((Task)methodImpls["ModifyChannel"](Client, arguments)); }
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); } }