Guild¶
discord_http.guild module¶
- class discord_http.guild.BanEntry(user, reason)[source]¶
Bases:
NamedTuple
- reason: str | None¶
Alias for field number 1
- class discord_http.guild.Guild(*, state: DiscordAPI, data: dict)[source]¶
Bases:
PartialGuild
- property bitrate_limit: int¶
The maximum bitrate the guild can have
- Type:
float
- property emojis_limit: int¶
The maximum amount of emojis the guild can have
- Type:
int
- property filesize_limit: int¶
The maximum filesize the guild can have
- Type:
int
- get_member_top_role(member: Member) Role | None [source]¶
Get the top role of a member, because Discord API does not order roles
- Parameters:
member (Member) – The member to get the top role of
- Returns:
The top role of the member
- Return type:
Optional[Role]
- get_role(role_id: int) Role | None [source]¶
Get a role from the guild
This simply returns the role from the role list in this object if it exists
- Parameters:
role_id (int) – The ID of the role to get
- Returns:
The role if it exists, else None
- Return type:
Optional[Role]
- get_role_by_name(role_name: str) Role | None [source]¶
Gets the first role with the specified name
- Parameters:
role_name (str) – The name of the role to get (case sensitive)
- Returns:
The role if it exists, else None
- Return type:
Optional[Role]
- property me: Member | PartialMember | None¶
Returns the bot’s member object. Only useable if you are using gateway and caching
- Type:
Optional[Member]
The guild’s premium subscriber role if available
- Type:
Optional[Role]
- property stickers_limit: int¶
The maximum amount of stickers the guild can have
- Type:
int
- class discord_http.guild.PartialGuild(*, state: DiscordAPI, id: int)[source]¶
Bases:
PartialBase
- async ban(member: Member | PartialMember | int, *, delete_message_days: int | None = 0, delete_message_seconds: int | None = 0, reason: str | None = None) None [source]¶
Ban a member from the server
- Parameters:
member (Union[Member, PartialMember, int]) – The member to ban
reason (Optional[str]) – The reason for banning the member
delete_message_days (Optional[int]) – How many days of messages to delete
delete_message_seconds (Optional[int]) – How many seconds of messages to delete
- async begin_guild_prune(*, days: int | None = 7, compute_prune_count: bool = True, include_roles: list[Role | PartialRole | int] | None = None, reason: str | None = None) int | None [source]¶
Begin a guild prune
- Parameters:
days (Optional[int]) – How many days of inactivity to prune for
compute_prune_count (bool) – Whether to return the amount of members that would be pruned
include_roles (Optional[list[Union[Role, PartialRole, int]]]) – Which roles to include in the prune
reason (Optional[str]) – The reason for beginning the prune
- Returns:
The amount of members that were pruned
- Return type:
Optional[int]
- async bulk_ban(*members: Member | PartialMember | int, delete_message_days: int | None = 0, delete_message_seconds: int | None = 0, reason: str | None = None) list[PartialMember] [source]¶
Ban multiple members from the server
- Parameters:
*members (Union[Member, PartialMember, int]) – The members to ban
- property categories: list[CategoryChannel]¶
list[CategoryChannel]: Returns a list of all the category channels in the guild if they are cached.
- property channels: list[BaseChannel | PartialChannel]¶
list[Union[BaseChannel, PartialChannel]]: Returns a list of all the channels in the guild if they are cached.
- property chunked: bool¶
Whether the guild is chunked or not
- Type:
bool
- async create_automod_rule(name: str, *, event_type: AutoModRuleEventType | int, trigger_type: AutoModRuleTriggerType | int, keyword_filter: list[str] | None = None, regex_patterns: list[str] | None = None, presets: list[AutoModRulePresetType] | None = None, allow_list: list[str] | None = None, mention_total_limit: int | None = None, mention_raid_protection_enabled: bool = False, alert_channel: Snowflake | int | None = None, timeout_seconds: int | None = None, message: str | None = None, enabled: bool = True, exempt_roles: list[Snowflake | int] | None = None, exempt_channels: list[Snowflake | int] | None = None, reason: str | None = None) AutoModRule [source]¶
Create an automod rule
- Parameters:
name (str) – Name of the automod
event_type (AutoModRuleEventType | int) – What type of event
trigger_type (AutoModRuleTriggerType | int) – What should make it get triggered
keyword_filter (list[str] | None) – Keywords to filter
regex_patterns (list[str] | None) – Keywords in regex pattern to filter
presets (list[AutoModRulePresetType] | None) – Automod presets to include
allow_list (list[str] | None) – List of keywords that are allowed
mention_total_limit (int | None) – How many unique mentions allowed before trigger
mention_raid_protection_enabled (bool) – If this should apply for raids
alert_channel (Snowflake | int | None) – Where the action should be logged
timeout_seconds (int | None) – How many seconds the user in question should be timed out
message (str | None) – What message the user gets when action is taken
enabled (bool) – If the automod should be enabled or not
exempt_roles (list[Snowflake | int] | None) – Which roles are allowed to bypass
exempt_channels (list[Snowflake | int] | None) – Which channels are allowed to bypass
reason (str | None) – Reason for creating the automod
- Returns:
The automod that was just created
- Return type:
AutoModRule
- async create_category(name: str, *, overwrites: list[PermissionOverwrite] | None = None, position: int | None = None, reason: str | None = None) CategoryChannel [source]¶
Create a category channel
- Parameters:
name (str) – The name of the category
overwrites (Optional[list[PermissionOverwrite]]) – The permission overwrites of the category
position (Optional[int]) – The position of the category
reason (Optional[str]) – The reason for creating the category
- Returns:
The created category
- Return type:
CategoryChannel
- async create_emoji(name: str, *, image: File | bytes, reason: str | None = None) Emoji [source]¶
Create an emoji
- Parameters:
name (str) – Name of the emoji
image (File) – File object to create an emoji from
reason (Optional[str]) – The reason for creating the emoji
- Returns:
The created emoji
- Return type:
Emoji
- async create_role(name: str, *, permissions: Permissions | None = None, color: Colour | Color | int | None = None, colour: Colour | Color | int | None = None, unicode_emoji: str | None = None, icon: File | bytes | None = None, hoist: bool = False, mentionable: bool = False, reason: str | None = None) Role [source]¶
Create a role
- Parameters:
name (str) – The name of the role
permissions (Optional[Permissions]) – The permissions of the role
color (Optional[Union[Colour, Color, int]]) – The colour of the role
colour (Optional[Union[Colour, Color, int]]) – The colour of the role
hoist (bool) – Whether the role should be hoisted
mentionable (bool) – Whether the role should be mentionable
unicode_emoji (Optional[str]) – The unicode emoji of the role
icon (Optional[File]) – The icon of the role
reason (Optional[str]) – The reason for creating the role
- Returns:
The created role
- Return type:
Role
- async create_scheduled_event(name: str, *, start_time: datetime | timedelta | int, end_time: datetime | timedelta | int | None = None, channel: PartialChannel | int | None = None, description: str | None = None, privacy_level: PrivacyLevelType | None = None, entity_type: ScheduledEventEntityType | None = None, external_location: str | None = None, image: File | bytes | None = None, reason: str | None = None) ScheduledEvent [source]¶
Create a scheduled event
- Parameters:
name (str) – The name of the event
start_time (Union[datetime, timedelta, int]) – The start time of the event
end_time (Optional[Union[datetime, timedelta, int]]) – The end time of the event
channel (Optional[Union[PartialChannel, int]]) – The channel of the event
description (Optional[str]) – The description of the event
privacy_level (Optional[PrivacyLevelType]) – The privacy level of the event (default is guild_only)
entity_type (Optional[ScheduledEventEntityType]) – The entity type of the event (default is voice)
external_location (Optional[str]) – The external location of the event
image (Optional[Union[File, bytes]]) – The image of the event
reason (Optional[str]) – The reason for creating the event
- Returns:
The created event
- Return type:
ScheduledEvent
- async create_soundboard_sound(name: str, *, sound: File | bytes, volume: int | None = None, emoji_id: str | None = None, emoji_name: str | None = None, reason: str | None = None) SoundboardSound [source]¶
Create a soundboard sound
- Parameters:
name (str) – Name of the soundboard sound
sound (File) – File object to create a soundboard sound from
volume (Optional[int]) – The volume of the soundboard sound
emoji_name (Optional[str]) – The unicode emoji of the soundboard sound
emoji_id (Optional[str]) – The ID of the custom emoji of the soundboard sound
reason (Optional[str]) – The reason for creating the soundboard sound
- Returns:
The created soundboard sound
- Return type:
SoundboardSound
- Raises:
ValueError – If both emoji_name and emoji_id are set
- async create_stage_channel(name: str, *, bitrate: int | None = None, user_limit: int | None = None, overwrites: list[PermissionOverwrite] | None = None, position: int | None = None, parent_id: Snowflake | int | None = None, video_quality_mode: VideoQualityType | int | None = None, reason: str | None = None) StageChannel [source]¶
Create a stage channel
- Parameters:
name (str) – The name of the channel
bitrate (Optional[int]) – The bitrate of the channel
user_limit (Optional[int]) – The user limit of the channel
overwrites (Optional[list[PermissionOverwrite]]) – The permission overwrites of the category
position (Optional[int]) – The position of the channel
video_quality_mode (Optional[Union[VideoQualityType, int]]) – The video quality mode of the channel
parent_id (Optional[Union[Snowflake, int]]) – The Category ID where the channel will be placed
reason (Optional[str]) – The reason for creating the stage channel
- Returns:
The created channel
- Return type:
StageChannel
- async create_sticker(name: str, *, description: str, emoji: str, file: File, reason: str | None = None) Sticker [source]¶
Create a sticker
- Parameters:
name (str) – Name of the sticker
description (str) – Description of the sticker
emoji (str) – Emoji that represents the sticker
file (File) – File object to create a sticker from
reason (Optional[str]) – The reason for creating the sticker
- Returns:
The created sticker
- Return type:
Sticker
- async create_text_channel(name: str, *, topic: str | None = None, position: int | None = None, rate_limit_per_user: int | None = None, overwrites: list[PermissionOverwrite] | None = None, parent_id: Snowflake | int | None = None, nsfw: bool | None = None, reason: str | None = None) TextChannel [source]¶
Create a text channel
- Parameters:
name (str) – The name of the channel
topic (Optional[str]) – The topic of the channel
rate_limit_per_user (Optional[int]) – The rate limit per user of the channel
overwrites (Optional[list[PermissionOverwrite]]) – The permission overwrites of the category
parent_id (Optional[Snowflake]) – The Category ID where the channel will be placed
nsfw (Optional[bool]) – Whether the channel is NSFW or not
reason (Optional[str]) – The reason for creating the text channel
- Returns:
The created channel
- Return type:
TextChannel
- async create_voice_channel(name: str, *, bitrate: int | None = None, user_limit: int | None = None, rate_limit_per_user: int | None = None, overwrites: list[PermissionOverwrite] | None = None, position: int | None = None, video_quality_mode: VideoQualityType | int | None = None, parent_id: Snowflake | int | None = None, nsfw: bool | None = None, reason: str | None = None) VoiceChannel [source]¶
Create a voice channel
- Parameters:
name (str) – The name of the channel
bitrate (Optional[int]) – The bitrate of the channel
user_limit (Optional[int]) – The user limit of the channel
rate_limit_per_user (Optional) – The rate limit per user of the channel
overwrites (Optional[list[PermissionOverwrite]]) – The permission overwrites of the category
position (Optional[int]) – The position of the channel
video_quality_mode (Optional[Union[VideoQualityType, int]]) – The video quality mode of the channel
parent_id (Optional[Snowflake]) – The Category ID where the channel will be placed
nsfw (Optional[bool]) – Whether the channel is NSFW or not
reason (Optional[str]) – The reason for creating the voice channel
- Returns:
The created channel
- Return type:
VoiceChannel
- property default_role: PartialRole¶
Returns the default role, but as a partial role object
- Type:
Role
- async edit(*, name: str | None = <MISSING>, verification_level: ~discord_http.enums.VerificationLevel | None = <MISSING>, default_message_notifications: ~discord_http.enums.DefaultNotificationLevel | None = <MISSING>, explicit_content_filter: ~discord_http.enums.ContentFilterLevel | None = <MISSING>, afk_channel_id: VoiceChannel | PartialChannel | int | None = <MISSING>, afk_timeout: int | None = <MISSING>, icon: ~discord_http.file.File | bytes | None = <MISSING>, owner_id: Member | PartialMember | int | None = <MISSING>, splash: ~discord_http.file.File | bytes | None = <MISSING>, discovery_splash: ~discord_http.file.File | None = <MISSING>, banner: ~discord_http.file.File | bytes | None = <MISSING>, system_channel_id: TextChannel | PartialChannel | int | None = <MISSING>, system_channel_flags: ~discord_http.flags.SystemChannelFlags | None = <MISSING>, rules_channel_id: TextChannel | PartialChannel | int | None = <MISSING>, public_updates_channel_id: TextChannel | PartialChannel | int | None = <MISSING>, preferred_locale: str | None = <MISSING>, description: str | None = <MISSING>, features: list[str] | None = <MISSING>, premium_progress_bar_enabled: bool | None = <MISSING>, safety_alerts_channel_id: TextChannel | PartialChannel | int | None = <MISSING>, reason: str | None = None) PartialGuild [source]¶
Edit the guild
- Parameters:
name (Optional[str]) – New name of the guild
verification_level (Optional[VerificationLevel]) – Verification level of the guild
default_message_notifications (Optional[DefaultNotificationLevel]) – Default message notification level of the guild
explicit_content_filter (Optional[ContentFilterLevel]) – Explicit content filter level of the guild
afk_channel_id (Optional[Union[VoiceChannel, PartialChannel, int]]) – AFK channel of the guild
afk_timeout (Optional[int]) – AFK timeout of the guild
icon (Optional[File]) – Icon of the guild
owner_id (Optional[Union[Member, PartialMember, int]]) – Owner of the guild
splash (Optional[File]) – Splash of the guild
discovery_splash (Optional[File]) – Discovery splash of the guild
banner (Optional[File]) – Banner of the guild
system_channel_id (Optional[Union[TextChannel, PartialChannel, int]]) – System channel of the guild
system_channel_flags (Optional[SystemChannelFlags]) – System channel flags of the guild
rules_channel_id (Optional[Union[TextChannel, PartialChannel, int]]) – Rules channel of the guild
public_updates_channel_id (Optional[Union[TextChannel, PartialChannel, int]]) – Public updates channel of the guild
preferred_locale (Optional[str]) – Preferred locale of the guild
description (Optional[str]) – Description of the guild
features (Optional[list[str]]) – Features of the guild
premium_progress_bar_enabled (Optional[bool]) – Whether the premium progress bar is enabled
safety_alerts_channel_id (Optional[Union[TextChannel, PartialChannel, int]]) – Safety alerts channel of the guild
reason (Optional[str]) – The reason for editing the guild
- Returns:
The edited guild
- Return type:
PartialGuild
- property emojis: list[Emoji | PartialEmoji]¶
list[Union[Emoji, PartialEmoji]]: Returns a list of all the emojis in the guild if they are cached.
- async fetch_audit_logs(*, before: datetime | AuditLogEntry | Snowflake | int | None = None, after: datetime | AuditLogEntry | Snowflake | int | None = None, user: Snowflake | int | None = None, action: AuditLogType | None = None, limit: int | None = 100) AsyncIterator[AuditLogEntry] [source]¶
Fetches the audit logs for the guild
- Parameters:
before (Optional[Union[datetime, AuditLogEntry, Snowflake, int]]) – Consider only entries before given entry
after (Optional[Union[datetime, AuditLogEntry, Snowflake, int]]) – Consider only entries after given entry
user (Optional[Union[Snowflake, int]]) – Consider only entries made by given user
action (Optional[AuditLogType]) – Consider only entries with given action
limit (Optional[int]) – The maximum amount of messages to fetch.
- Returns:
The audit logs for the guild
- Return type:
list[AuditLogEntry]
- async fetch_automod_rule(automod_id: int) AutoModRule [source]¶
AutoModRule: Fetches a automod rule from the guild
- async fetch_automod_rules() list[AutoModRule] [source]¶
list[AutoModRule] Fetches all the automod rules in the guild
- async fetch_ban(user: Snowflake | int) BanEntry [source]¶
Fetches a user’s ban of the guild
- Parameters:
user (Snowflake | int) – The user to fetch the ban of
- Returns:
Ban entry that was found
- Return type:
BanEntry
- async fetch_bans(*, before: Snowflake | int | None = None, after: Snowflake | int | None = None, limit: int | None = 1000) AsyncIterator[BanEntry] [source]¶
Fetch the bans of the guild
- Parameters:
before (Optional[Union[Snowflake, int]]) – Consider only users before given user id
after (Optional[Union[Snowflake, int]]) – Consider only users after given user id
limit (Optional[int]) – The maximum amount of messages to fetch. None will fetch all users.
- Yields:
Message – The message object
- async fetch_channel(channel_id: int) BaseChannel [source]¶
Fetch a channel from the guild
- Parameters:
channel_id (int) – The ID of the channel
- Returns:
The channel object
- Return type:
BaseChannel
- async fetch_channels() list[type[BaseChannel]] [source]¶
list[BaseChannel]: Fetches all the channels in the guild
- async fetch_guild_prune_count(*, days: int | None = 7, include_roles: list[Role | PartialRole | int] | None = None) int [source]¶
Fetch the amount of members that would be pruned
- Parameters:
days (Optional[int]) – How many days of inactivity to prune for
include_roles (Optional[list[Union[Role, PartialRole, int]]]) – Which roles to include in the prune
- Returns:
The amount of members that would be pruned
- Return type:
int
- async fetch_integrations() list[Integration] [source]¶
Fetches the integrations for the guild.
This requires the MANAGE_GUILD permission.
- Returns:
The integrations in the guild.
- Return type:
list[Integration]
- async fetch_member(member_id: int) Member [source]¶
Fetch a member from the guild
- Parameters:
member_id (int) – The ID of the member
- Returns:
The member object
- Return type:
Member
- async fetch_members(*, limit: int | None = 1000, after: Snowflake | int | None = None) AsyncIterator[Member] [source]¶
Fetches all the members in the guild
- Parameters:
limit (Optional[int]) – The maximum amount of members to return
after (Optional[Union[Snowflake, int]]) – The member to start after
- Yields:
Members – The members in the guild
- async fetch_public_threads() list[PublicThread] [source]¶
Fetches all the public threads in the guild
- Returns:
The public threads in the guild
- Return type:
list[PublicThread]
- async fetch_regions() list[VoiceRegion] [source]¶
list[VoiceRegion]: Fetches all the voice regions for the guild
- async fetch_scheduled_event(id: int) ScheduledEvent [source]¶
Fetches a scheduled event object.
- Parameters:
id (int) – The ID of the scheduled event.
- Returns:
The scheduled event object.
- Return type:
ScheduledEvent
- async fetch_scheduled_events_list() list[ScheduledEvent] [source]¶
list[ScheduledEvent]: Fetches all the scheduled events in the guild
- async fetch_soundboard_sound(sound_id: int) SoundboardSound [source]¶
SoundboardSound: Fetches a soundboard sound from the guild
- async fetch_soundboard_sounds() list[SoundboardSound] [source]¶
list[SoundboardSound]: Fetches all the soundboard sounds in the guild
- async fetch_sticker(sticker_id: int) Sticker [source]¶
Fetch a sticker from the guild
- Parameters:
sticker_id (int) – The ID of the sticker
- Returns:
The sticker object
- Return type:
Sticker
- get_channel(channel_id: int) BaseChannel | PartialChannel | None [source]¶
Returns the channel from cache if it exists.
- Parameters:
channel_id (int) – The ID of the channel to get.
- Returns:
The channel with the given ID, if it exists.
- Return type:
Optional[Union[“BaseChannel”, “PartialChannel”]
- get_channel_voice_states(channel_id: int) list[VoiceState | PartialVoiceState] [source]¶
- get_member(member_id: int) Member | PartialMember | None [source]¶
Returns the member from cache if it exists.
- Parameters:
member_id (int) – The ID of the member to get.
- Returns:
The member with the given ID, if it exists.
- Return type:
Optional[Union[“Member”, “PartialMember”]
- get_member_voice_state(member_id: int) VoiceState | PartialVoiceState | None [source]¶
Returns the voice state of a member from cache if it exists.
- Parameters:
member_id (int) – The ID of the member to get the voice state of.
- Returns:
The voice state of the member, if it exists.
- Return type:
Optional[Union[“VoiceState”, “PartialVoiceState”]
- get_partial_automod_rule(automod_id: int) PartialAutoModRule [source]¶
PartialAutoModRule: Returns a partial automod rule object
- get_partial_channel(channel_id: int) PartialChannel [source]¶
Get a partial channel object
- Parameters:
channel_id (int) – The ID of the channel
- Returns:
The partial channel object
- Return type:
PartialChannel
- get_partial_emoji(emoji_id: int) PartialEmoji [source]¶
Get a partial emoji object
- Parameters:
emoji_id (int) – The ID of the emoji
- Returns:
The partial emoji object
- Return type:
PartialEmoji
- get_partial_member(member_id: int) PartialMember [source]¶
Get a partial member object
- Parameters:
member_id (int) – The ID of the member
- Returns:
The partial member object
- Return type:
PartialMember
- get_partial_role(role_id: int) PartialRole [source]¶
Get a partial role object
- Parameters:
role_id (int) – The ID of the role
- Returns:
The partial role object
- Return type:
PartialRole
- get_partial_scheduled_event(id: int) PartialScheduledEvent [source]¶
Creates a partial scheduled event object.
- Parameters:
id (int) – The ID of the scheduled event.
- Returns:
The partial scheduled event object.
- Return type:
PartialScheduledEvent
- get_partial_soundboard_sound(sound_id: int) PartialSoundboardSound [source]¶
Get a partial soundboard sound object
- Parameters:
sound_id (int) – The ID of the sound
- Returns:
The partial soundboard sound object
- Return type:
PartialEmoji
- get_partial_sticker(sticker_id: int) PartialSticker [source]¶
Get a partial sticker object
- Parameters:
sticker_id (int) – The ID of the sticker
- Returns:
The partial sticker object
- Return type:
PartialSticker
- get_role(role_id: int) Role | PartialRole | None [source]¶
Returns the role from cache if it exists.
- Parameters:
role_id (int) – The ID of the role to get.
- Returns:
The role with the given ID, if it exists.
- Return type:
Optional[Union[“Role”, “PartialRole”]
- get_soundboard_sound(sound_id: int) SoundboardSound | PartialSoundboardSound | None [source]¶
Returns the soundboard sound from cache if it exists.
- Parameters:
sound_id (int) – The ID of the soundboard sound to get.
- Returns:
The soundboard sound with the given ID, if it exists.
- Return type:
Optional[Union[“SoundboardSound”, “PartialSoundboardSound”]
- get_thread(thread_id: int) BaseChannel | PartialChannel | None [source]¶
Returns the thread from cache if it exists.
- Parameters:
thread_id (int) – The ID of the thread to get.
- Returns:
The thread with the given ID, if it exists.
- Return type:
Optional[Union[“PartialThread”, “PartialChannel”]
- get_voice_states() list[VoiceState | PartialVoiceState] [source]¶
Optional[Union[VoiceState, PartialVoiceState]]: Returns the voice state of the guild
- async kick(member: Member | PartialMember | int, *, reason: str | None = None) None [source]¶
Kick a member from the server
- Parameters:
member (Union[Member, PartialMember, int]) – The member to kick
reason (Optional[str]) – The reason for kicking the member
- property large: bool¶
Whether the guild is considered large
- Type:
bool
- property members: list[Member | PartialMember]¶
list[Union[Member, PartialMember]]: Returns a list of all the members in the guild if they are cached.
- property roles: list[Role | PartialRole]¶
list[Union[Role, PartialRole]]: Returns a list of all the roles in the guild if they are cached or if the guild was fetched
- async search_members(query: str, *, limit: int | None = 100) list[Member] [source]¶
Search for members in the guild
- Parameters:
query (str) – The query to search for
limit (Optional[int]) – The maximum amount of members to return
- Returns:
The members that matched the query
- Return type:
list[Member]
- Raises:
ValueError – If the limit is not between 1 and 1000
- property soundboard_sounds: list[SoundboardSound | PartialSoundboardSound]¶
list[Union[SoundboardSound, PartialSoundboardSound]]: Returns a list of all the soundboard sounds in the guild if they are cached.
- property stickers: list[Sticker | PartialSticker]¶
list[Union[Sticker, PartialSticker]]: Returns a list of all the stickers in the guild if they are cached.
- property text_channels: list[TextChannel]¶
list[TextChannel]: Returns a list of all the text channels in the guild if they are cached.
- property threads: list[BaseChannel | PartialChannel]¶
list[Union[BaseChannel, PartialChannel]]: Returns a list of all the threads in the guild if they are cached.
- async unban(member: Member | PartialMember | int, *, reason: str | None = None) None [source]¶
Unban a member from the server
- Parameters:
member (Union[Member, PartialMember, int]) – The member to unban
reason (Optional[str]) – The reason for unbanning the member
- property voice_channels: list[VoiceChannel]¶
list[VoiceChannel]: Returns a list of all the voice channels in the guild if they are cached.
- class discord_http.guild.PartialScheduledEvent(*, state: DiscordAPI, id: int, guild_id: int)[source]¶
Bases:
PartialBase
- async delete(*, reason: str | None = None) None [source]¶
Delete the event (the bot must own the event)
- async edit(*, name: str | None = <MISSING>, description: str | None = <MISSING>, channel: PartialChannel | int | None = <MISSING>, external_location: str | None = <MISSING>, privacy_level: ~discord_http.enums.PrivacyLevelType | None = <MISSING>, entity_type: ~discord_http.enums.ScheduledEventEntityType | None = <MISSING>, status: ~discord_http.enums.ScheduledEventStatusType | None = <MISSING>, start_time: ~datetime.datetime | ~datetime.timedelta | int | None = <MISSING>, end_time: ~datetime.datetime | ~datetime.timedelta | int | None = <MISSING>, image: ~discord_http.file.File | bytes | None = <MISSING>, reason: str | None = None) ScheduledEvent [source]¶
Edit the event
- Parameters:
name (Optional[str]) – New name of the event
description (Optional[str]) – New description of the event
channel (Optional[Union["PartialChannel", int]]) – New channel of the event
privacy_level (Optional[PrivacyLevelType]) – New privacy level of the event
entity_type (Optional[ScheduledEventEntityType]) – New entity type of the event
status (Optional[ScheduledEventStatusType]) – New status of the event
start_time (Optional[Union[datetime, timedelta, int]]) – New start time of the event
end_time (Optional[Union[datetime, timedelta, int]]) – New end time of the event (only for external events)
image (Optional[Union[File, bytes]]) – New image of the event
reason (Optional[str]) – The reason for editing the event
- Returns:
The edited event
- Return type:
ScheduledEvent
- Raises:
ValueError – If the start_time is None
- async fetch() ScheduledEvent [source]¶
ScheduledEvent: Fetches more information about the event
- property guild: Guild | PartialGuild¶
The guild object this event is in
- Type:
PartialGuild
- property url: str¶
- class discord_http.guild.ScheduledEvent(*, state: DiscordAPI, data: dict)[source]¶
Bases:
PartialScheduledEvent