Skip to content

Guilds

Implementations for the guilds endpoint.

Guilds

Bases: HTTPAwareEndpoint

A class with implementations for the guilds endpoint.

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

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

    @with_permission_check("guilds")
    async def get_guild(self: HTTPAwareEndpoint, guild_id: int) -> GetGuildResponse:
        """Get extensive guild information.

        Parameters
        ----------
        guild_id : int
            Guild ID of the guild to look up.

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

        Returns
        -------
        GetGuildResponse
            A model response from `ravyapi.api.endpoints.guilds.Guilds.get_guild`.
            Located as `ravyapi.api.models.guilds.GetGuildResponse`.
        """
        if not isinstance(guild_id, int):
            raise TypeError('Parameter "guild_id" must be of type "int"')

        return GetGuildResponse(
            await self._http.get(
                self._http.paths.guilds(guild_id).route,
            )
        )

get_guild(guild_id) async

Get extensive guild information.

Parameters

guild_id : int Guild ID of the guild to look up.

Raises

TypeError If any parameters are of invalid types.

Returns

GetGuildResponse A model response from ravyapi.api.endpoints.guilds.Guilds.get_guild. Located as ravyapi.api.models.guilds.GetGuildResponse.

Source code in ravyapi/api/endpoints/guilds.py
@with_permission_check("guilds")
async def get_guild(self: HTTPAwareEndpoint, guild_id: int) -> GetGuildResponse:
    """Get extensive guild information.

    Parameters
    ----------
    guild_id : int
        Guild ID of the guild to look up.

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

    Returns
    -------
    GetGuildResponse
        A model response from `ravyapi.api.endpoints.guilds.Guilds.get_guild`.
        Located as `ravyapi.api.models.guilds.GetGuildResponse`.
    """
    if not isinstance(guild_id, int):
        raise TypeError('Parameter "guild_id" must be of type "int"')

    return GetGuildResponse(
        await self._http.get(
            self._http.paths.guilds(guild_id).route,
        )
    )