Skip to content

Ksoft

Implementations for the ksoft endpoint.

KSoft

Bases: HTTPAwareEndpoint

A class with implementations for the ksoft endpoint.

Source code in ravyapi/api/endpoints/ksoft.py
class KSoft(HTTPAwareEndpoint):
    """A class with implementations for the `ksoft` endpoint."""

    __slots__: tuple[str, ...] = ()

    @with_permission_check("ksoft.bans")
    async def get_ban(self: HTTPAwareEndpoint, user_id: int) -> GetKSoftBanResponse:
        """Get ban status.

        Parameters
        ----------
        user_id : int
            User ID of the user to look up.

        Raises
        ------
        TypeError
            If any parameters are of invalid types.

        Returns
        -------
        GetKSoftBanResponse
            A model response from `ravyapi.api.endpoints.ksoft.KSoft.get_ban`.
            Located as `ravyapi.api.models.ksoft.GetKSoftBanResponse`.
        """
        if not isinstance(user_id, int):
            raise TypeError('Parameter "user_id" must be of type "int"')

        return GetKSoftBanResponse(
            await self._http.get(
                self._http.paths.ksoft.bans(user_id),
            )
        )

get_ban(user_id) async

Get ban status.

Parameters

user_id : int User ID of the user to look up.

Raises

TypeError If any parameters are of invalid types.

Returns

GetKSoftBanResponse A model response from ravyapi.api.endpoints.ksoft.KSoft.get_ban. Located as ravyapi.api.models.ksoft.GetKSoftBanResponse.

Source code in ravyapi/api/endpoints/ksoft.py
@with_permission_check("ksoft.bans")
async def get_ban(self: HTTPAwareEndpoint, user_id: int) -> GetKSoftBanResponse:
    """Get ban status.

    Parameters
    ----------
    user_id : int
        User ID of the user to look up.

    Raises
    ------
    TypeError
        If any parameters are of invalid types.

    Returns
    -------
    GetKSoftBanResponse
        A model response from `ravyapi.api.endpoints.ksoft.KSoft.get_ban`.
        Located as `ravyapi.api.models.ksoft.GetKSoftBanResponse`.
    """
    if not isinstance(user_id, int):
        raise TypeError('Parameter "user_id" must be of type "int"')

    return GetKSoftBanResponse(
        await self._http.get(
            self._http.paths.ksoft.bans(user_id),
        )
    )