Skip to content

function kick

Note

The reason string can't be longer than 255 characters.

This function will kick the player from the server.
Original: kick

Declaration

async def kick(id : int, reason : str)

Parameters

int id: the reason why player was kicked.
str reason: the reason why player was kicked.

Source code in src/pyg2o/functions/player.py
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
async def kick(id : int, reason : str):
    """
    !!! note
        The reason string can't be longer than 255 characters.
    This function will kick the player from the server.
    Original: [kick](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/player/kick/)

    ## Declaration
    ```python
    async def kick(id : int, reason : str)
    ```
    ## Parameters
    `int` **id**: the reason why player was kicked.
    `str` **reason**: the reason why player was kicked.
    """
    data = f'return {get_call_repr()}'

    server = await PythonWebsocketServer.get_server()
    result = await server.make_request(data)
    return result