Updating a Channel

Last Edit: Mar 03 2020

You can edit a Channel using the update method:


const update = await channel.update(
    {
        name: 'myspecialchannel',
        color: 'green',
    },
    { text: 'Thierry changed the channel color to green' },
);
                    

await channel.update({
  "name": "myspecialchannel",
  "color": "green",
}, Message(text: "Thierry changed the channel color to green"));
                    

$update = $channel->update(
	[
		'name'    => 'myspecialchannel', 
		'color'	  => 'green'
	],
	[ 
		'text' => 'Thierry changed the channel color to green',
		'user_id' => 'thierry'
	]
);
                    

val updateMessage = Message()
updateMessage.text = "Thierry changed the channel color to green"
channelController.update(updateMessage).enqueue {
    val channel = it.data()
}
                    

Request Params

Name

Type

Description

channel data

object

Object with the new channel information. One special field is frozen. If you set that to true new messages will be blocked.

message

object

Message object allowing you to show a system message in the Channel that something changed.