Skip to content

Guild Resource

Note

The following classes come from the scurrypy.resources.guild module.


Guild dataclass

Bases: BaseResource

Represents a Discord guild.

id: int instance-attribute

ID of the guild.

context: Any instance-attribute

Associated user data.

fetch async

Fetch the Guild object by the given ID.

Parameters:

  • **kwargs (Unpack[FetchGuildParams], default: {} ) –

    guild fetch params

    Note

    If no kwargs are provided, default to with_counts = False

Returns:

fetch_channels async

Fetch this guild's channels.

Returns:

create_channel async

Create a channel in this guild.

Permissions
  • MANAGE_CHANNELS → required to create a channel

Parameters:

Returns:

fetch_guild_member async

Fetch a member in this guild.

Important

Requires the GUILD_MEMBERS privileged intent!

Parameters:

  • user_id (int) –

    user ID of the member to fetch

Returns:

fetch_guild_members async

Fetch guild members in this guild.

Important

Requires the GUILD_MEMBERS privileged intent!

Parameters:

  • **kwargs (Unpack[FetchGuildMembersParams], default: {} ) –

    guild members fetch params

    Note

    If no kwargs are provided, default to 1 guild member limit.

Returns:

add_guild_member_role async

Append a role to a guild member of this guild.

Permissions
  • MANAGE_ROLES → required to add a role to the user

Parameters:

  • user_id (int) –

    ID of the member for the role

  • role_id (int) –

    ID of the role to append

remove_guild_member_role async

Remove a role from a guild member of this guild.

Permissions
  • MANAGE_ROLES → required to remove a role from the user

Parameters:

  • user_id (int) –

    ID of the member with the role

  • role_id (int) –

    ID of the role to remove

fetch_guild_role async

Fetch a role in this guild.

Parameters:

  • role_id (int) –

    ID of the role to fetch

Returns:

fetch_guild_roles async

Fetch all roles in this guild.

Returns:

  • list[RoleModel]

    list of fetched roles' data

create_guild_role async

Create a role in this guild.

Permissions
  • MANAGE_ROLES → required to add a role to the guild

Parameters:

  • role (Role) –

    role to create

Returns:

modify_guild_role async

Modify a role in this guild.

Permissions
  • MANAGE_ROLES → required to modify a role in the guild

Parameters:

  • role (Role) –

    role with changes

Returns:

delete_guild_role async

Delete a role in this guild.

Permissions
  • MANAGE_ROLES → required to delete a role in the guild

Parameters:

  • role_id (int) –

    ID of role to delete


FetchGuildParams

Bases: TypedDict

Params when fetching a guild.

with_counts: Optional[bool] instance-attribute

If True, return the approximate member and presence counts for the guild.


FetchGuildMembersParams

Bases: TypedDict

Params when fetching guild members.

limit: int instance-attribute

Max number of members to return Range 1 - 1000. Default 1.

after: int instance-attribute

Highest user ID in previous page.