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:
-
GuildModel–the Guild object
fetch_channels
async
¶
create_channel
async
¶
Create a channel in this guild.
Parameters:
-
channel(GuildChannel) –the buildable guild channel
Returns:
-
ChannelModel–the created channel
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:
-
GuildMemberModel–member's data
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:
-
list[GuildMemberModel]–list of member data
add_guild_member_role
async
¶
Append a role to a guild member of this guild.
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.
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:
-
RoleModel–fetched role's data
fetch_guild_roles
async
¶
create_guild_role
async
¶
modify_guild_role
async
¶
delete_guild_role
async
¶
Delete a role in this 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.