Kicking clients
| Interacting with the server |

### Kicking clients

Clients can be forcefully removed from a channel or the whole server. To kick a client from a channel or server call:

`unsigned int ts3client_requestClientKickFromChannel(` | serverConnectionHandlerID, |
| clID, |
| kickReason, |
| returnCode`)`; |

`anyID serverConnectionHandlerID`;
`anyID clID`;
`const char* kickReason`;
`const char* returnCode`;

`unsigned int ts3client_requestClientKickFromServer(` | serverConnectionHandlerID, |
| clID, |
| kickReason, |
| returnCode`)`; |

`anyID serverConnectionHandlerID`;
`anyID clID`;
`const char* kickReason`;
`const char* returnCode`;

Parameters

- `serverConnectionHandlerID`

  Id of the target server connection.

- `clID`

  The ID of the client to be kicked.

- `kickReason`

  A short message explaining why the client is kicked from the channel or server.

- `returnCode`

  See return code documentation. Pass NULL if you do not need this feature.

Returns `ERROR_ok` on success, otherwise an error code as defined in `public_errors.h`.

After successfully requesting a kick, one of the following events will be called:

`void onClientKickFromChannelEvent(` | serverConnectionHandlerID, |
| clientID, |
| oldChannelID, |
| newCHannelID, |
| visibility, |
| kickerID, |
| kickerName, |
| kickerUniqueIdentifier, |
| kickMessage`)`; |

`anyID serverConnectionHandlerID`;
`anyID clientID`;
`anyID oldChannelID`;
`anyID newCHannelID`;
`int visibility`;
`anyID kickerID`;
`const char* kickerName`;
`const char* kickerUniqueIdentifier`;
`const char* kickMessage`;

`void onClientKickFromServerEvent(` | serverConnectionHandlerID, |
| clientID, |
| oldChannelID, |
| newChannelID, |
| visibility, |
| kickerID, |
| kickerName, |
| kickerUniqueIdentifier, |
| kickMessage`)`; |

`anyID serverConnectionHandlerID`;
`anyID clientID`;
`anyID oldChannelID`;
`anyID newChannelID`;
`int visibility`;
`anyID kickerID`;
`const char* kickerName`;
`const char* kickerUniqueIdentifier`;
`const char* kickMessage`;

Parameters

- `serverConnectionHandlerID`

  ID of the server connection handler on which the client was kicked

- `clientID`

  ID of the kicked client.

- `oldChannelID`

  ID of the channel from which the client has been kicked.

- `newChannelID`

  ID of the channel where the kicked client was moved to.

- `visibility`

  Describes if the moved client enters, retains or leaves visibility. See explanation of the enum Visibility for the function `onClientMoveEvent`.

  When kicked from a server, visibility can be only `LEAVE_VISIBILITY`.

- `kickerID`

  ID of the client who requested the kick.

- `kickerName`

  Name of the client who requested the kick.

- `kickerUniqueIdentifier`

  Unique ID of the client who requested the kick.

- `kickerMessage`

  Message giving the reason why the client has been kicked.

Text chat |  | Channel subscriptions