REST 分组¶
bot.rest 的每个属性都是一组操作,这里列出了每个操作及其接受的选项。REST 指南解释了其中的约定。
bostie.rest.REST
¶
REST(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None, deletions: set[Task[None]])
bot.rest: each attribute is a group of Discord's REST operations.
deletions holds the pending delete_after tasks, for its owner to cancel.
bostie.rest.BearerREST
¶
BearerREST(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
What an OAuth2 access token reaches, for the user who granted it.
bostie.rest.application
¶
ApplicationEdit
¶
Bases: TypedDict
flags takes only the limited intent flags.
integration_types_config
instance-attribute
¶
integration_types_config: Mapping[ApplicationIntegrationType, ApplicationIntegrationTypeConfiguration]
Application
¶
Application(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
Bases: ResourceGroup
fetch_bot_application
async
¶
fetch_bot_application() -> Application
The bot's application, through the OAuth2 route that fetch mirrors.
fetch_activity_instance
async
¶
fetch_activity_instance(application_id: int, instance_id: str) -> ActivityInstance
list_role_connection_metadata
async
¶
list_role_connection_metadata(application_id: int) -> tuple[ApplicationRoleConnectionMetadata, ...]
update_role_connection_metadata
async
¶
update_role_connection_metadata(application_id: int, /, records: Sequence[ApplicationRoleConnectionMetadata]) -> tuple[ApplicationRoleConnectionMetadata, ...]
Replace the app's role connection metadata, at most 5 records.
bostie.rest.audit_log
¶
AuditLogList
¶
AuditLog
¶
AuditLog(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
Bases: ResourceGroup
list
¶
list(guild_id: int, /, **options: Unpack[AuditLogList]) -> AsyncIterator[AuditLogPage]
Walk the audit log a page at a time, newest first, or oldest with after.
bostie.rest.auto_moderation
¶
AutoModeration
¶
AutoModeration(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
Bases: ResourceGroup
create
async
¶
create(guild_id: int, /, *, reason: str | None = None, **options: Unpack[AutoModerationCreate]) -> AutoModerationRule
edit
async
¶
edit(guild_id: int, rule_id: int, /, *, reason: str | None = None, **options: Unpack[AutoModerationEdit]) -> AutoModerationRule
bostie.rest.bans
¶
BanBulkCreate
¶
BanCreate
¶
BanList
¶
Bans
¶
Bans(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
Bases: ResourceGroup
bulk_create
async
¶
bulk_create(guild_id: int, /, *, reason: str | None = None, **options: Unpack[BanBulkCreate]) -> BulkBan
create
async
¶
create(guild_id: int, user_id: int, /, *, reason: str | None = None, **options: Unpack[BanCreate]) -> None
bostie.rest.channels
¶
PermissionOverwrite
¶
ChannelPosition
¶
ChannelCreate
¶
ChannelEdit
¶
Bases: TypedDict
The settings of a group DM, guild channel or thread to change.
permission_overwrites
instance-attribute
¶
permission_overwrites: Sequence[PermissionOverwrite] | None
ChannelFollow
¶
ChannelAddRecipient
¶
ChannelCreateGroupDm
¶
Channels
¶
Channels(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
Bases: ResourceGroup
add_recipient
async
¶
add_recipient(channel_id: int, user_id: int, /, **options: Unpack[ChannelAddRecipient]) -> None
create
async
¶
create(guild_id: int, /, *, reason: str | None = None, **options: Unpack[ChannelCreate]) -> Channel
create_dm
async
¶
create_dm(**options: Unpack[ChannelCreateDm]) -> Channel
Open the bot's DM channel with a user; a cache that keeps DMs keeps it.
delete_permission
async
¶
edit
async
¶
edit(channel_id: int, /, *, reason: str | None = None, **options: Unpack[ChannelEdit]) -> Channel
edit_permissions
async
¶
edit_permissions(channel_id: int, overwrite_id: int, /, *, reason: str | None = None, **options: Unpack[ChannelEditPermissions]) -> None
edit_positions
async
¶
edit_positions(guild_id: int, /, positions: Sequence[ChannelPosition], *, reason: str | None = None) -> None
fetch_member_permissions
async
¶
fetch_member_permissions(channel_id: int, user_id: int, /, **options: Unpack[ChannelFetchPermissions]) -> Permissions
The member's permissions in the channel, with its roles and overwrites.
fetch_role_permissions
async
¶
fetch_role_permissions(channel_id: int, role_id: int, /, **options: Unpack[ChannelFetchPermissions]) -> Permissions
The permissions of the role and @everyone in the channel.
follow
async
¶
follow(channel_id: int, /, *, reason: str | None = None, **options: Unpack[ChannelFollow]) -> FollowedChannel
set_voice_status
async
¶
set_voice_status(channel_id: int, /, *, reason: str | None = None, **options: Unpack[ChannelSetVoiceStatus]) -> None
bostie.rest.commands
¶
CommandCreateGuild
¶
Bases: _CommandFields
CommandCreate
¶
Bases: CommandCreateGuild, _GlobalCommandFields
CommandEditGuild
¶
Bases: _CommandFields
CommandEdit
¶
Bases: CommandEditGuild, _GlobalCommandFields
CommandBulkOverwrite
¶
Commands
¶
Commands(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
Bases: _CommandPermissions
bulk_overwrite
async
¶
bulk_overwrite(application_id: int, /, commands: Sequence[CommandBulkOverwrite]) -> tuple[ApplicationCommand, ...]
Replace every global command of the app with commands.
bulk_overwrite_guild
async
¶
bulk_overwrite_guild(application_id: int, guild_id: int, /, commands: Sequence[CommandBulkOverwrite]) -> tuple[ApplicationCommand, ...]
Replace every command of the app in one guild with commands.
create
async
¶
create(application_id: int, /, **options: Unpack[CommandCreate]) -> ApplicationCommand
Create a global command, or replace the one with the same name.
create_guild
async
¶
create_guild(application_id: int, guild_id: int, /, **options: Unpack[CommandCreateGuild]) -> ApplicationCommand
Create a guild command, or replace the one with the same name.
edit
async
¶
edit(application_id: int, command_id: int, /, **options: Unpack[CommandEdit]) -> ApplicationCommand
edit_guild
async
¶
edit_guild(application_id: int, guild_id: int, command_id: int, /, **options: Unpack[CommandEditGuild]) -> ApplicationCommand
fetch_guild
async
¶
fetch_guild(application_id: int, guild_id: int, command_id: int) -> ApplicationCommand
list
async
¶
list(application_id: int, /, **options: Unpack[CommandList]) -> tuple[ApplicationCommand, ...]
list_guild
async
¶
list_guild(application_id: int, guild_id: int, /, **options: Unpack[CommandList]) -> tuple[ApplicationCommand, ...]
fetch_permissions
async
¶
fetch_permissions(application_id: int, guild_id: int, command_id: int) -> GuildCommandPermissions
list_permissions
async
¶
list_permissions(application_id: int, guild_id: int) -> tuple[GuildCommandPermissions, ...]
BearerCommands
¶
BearerCommands(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
Bases: _CommandPermissions
edit_permissions
async
¶
edit_permissions(application_id: int, guild_id: int, command_id: int, /, permissions: Sequence[CommandPermission]) -> GuildCommandPermissions
Overwrite who may use the command in the guild; at most 100 entries.
fetch_permissions
async
¶
fetch_permissions(application_id: int, guild_id: int, command_id: int) -> GuildCommandPermissions
list_permissions
async
¶
list_permissions(application_id: int, guild_id: int) -> tuple[GuildCommandPermissions, ...]
bostie.rest.emojis
¶
EmojiCreate
¶
EmojiEdit
¶
EmojiCreateApplication
¶
Emojis
¶
Emojis(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
Bases: ResourceGroup
create
async
¶
create(guild_id: int, /, *, reason: str | None = None, **options: Unpack[EmojiCreate]) -> Emoji
create_application
async
¶
create_application(application_id: int, /, **options: Unpack[EmojiCreateApplication]) -> Emoji
edit
async
¶
edit(guild_id: int, emoji_id: int, /, *, reason: str | None = None, **options: Unpack[EmojiEdit]) -> Emoji
bostie.rest.gateway
¶
Gateway
¶
Gateway(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
Bases: ResourceGroup
bostie.rest.guilds
¶
GuildBeginPrune
¶
GuildEdit
¶
Bases: TypedDict
default_message_notifications
instance-attribute
¶
default_message_notifications: DefaultMessageNotificationLevel | None
explicit_content_filter
instance-attribute
¶
explicit_content_filter: ExplicitContentFilterLevel | None
GuildEditIncidentActions
¶
GuildEditWelcomeScreen
¶
GuildEditWidget
¶
GuildFetchPruneCount
¶
GuildFetchWidgetImage
¶
GuildList
¶
BearerGuilds
¶
BearerGuilds(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
Bases: ResourceGroup
list
¶
list(**options: Unpack[GuildList]) -> AsyncIterator[CurrentUserGuild]
Walk the user's guilds oldest first, or newest first with before.
Guilds
¶
Guilds(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
Bases: BearerGuilds
begin_prune
async
¶
begin_prune(guild_id: int, /, *, reason: str | None = None, **options: Unpack[GuildBeginPrune]) -> int | None
Kick inactive members; the count is None with compute_prune_count=False.
edit
async
¶
edit_incident_actions
async
¶
edit_incident_actions(guild_id: int, /, **options: Unpack[GuildEditIncidentActions]) -> IncidentsData
edit_welcome_screen
async
¶
edit_welcome_screen(guild_id: int, /, *, reason: str | None = None, **options: Unpack[GuildEditWelcomeScreen]) -> WelcomeScreen
edit_widget
async
¶
edit_widget(guild_id: int, /, *, reason: str | None = None, **options: Unpack[GuildEditWidget]) -> GuildWidgetSettings
fetch_prune_count
async
¶
fetch_prune_count(guild_id: int, /, **options: Unpack[GuildFetchPruneCount]) -> int
How many members begin_prune would kick with the same options.
fetch_widget_image
async
¶
fetch_widget_image(guild_id: int, /, **options: Unpack[GuildFetchWidgetImage]) -> bytes
The widget as a PNG image.
list
¶
list(**options: Unpack[GuildList]) -> AsyncIterator[CurrentUserGuild]
Walk the user's guilds oldest first, or newest first with before.
bostie.rest.identities
¶
Identities
¶
Identities(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
Bases: ResourceGroup
delete
async
¶
delete(user_id: int, application_id: int, provider_type: str, provider_issued_user_id: str, /, *, provider_id: str | None = None) -> None
Delete the identity and its profile, unless it is the last linked one.
fetch_profile
async
¶
fetch_profile(application_id: int, user_id: int, provider_issued_user_id: str) -> ApplicationIdentityProfile
list_by_external_id
async
¶
list_by_external_id(application_id: int, provider_type: str, provider_issued_user_id: str, /, *, provider_id: str | None = None) -> tuple[ApplicationIdentity, ...]
The identities of the user the external account belongs to, if any.
update_profile
async
¶
update_profile(application_id: int, user_id: int, provider_issued_user_id: str, /, **options: Unpack[IdentityUpdateProfile]) -> ApplicationIdentityProfile | None
Replace the profile with data; only the first write returns it.
bostie.rest.integrations
¶
Integrations
¶
Integrations(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
bostie.rest.invites
¶
InviteFetch
¶
InviteBulkAddTargetUsers
¶
InviteBulkDeleteTargetUsers
¶
InviteUpdateTargetUsers
¶
Invites
¶
Invites(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
Bases: ResourceGroup
bulk_add_target_users
async
¶
bulk_add_target_users(code: str, /, **options: Unpack[InviteBulkAddTargetUsers]) -> None
bulk_delete_target_users
async
¶
bulk_delete_target_users(code: str, /, **options: Unpack[InviteBulkDeleteTargetUsers]) -> None
create
async
¶
create(channel_id: int, /, *, reason: str | None = None, **options: Unpack[InviteCreate]) -> Invite | InviteWithMetadata
list_guild
async
¶
list_guild(guild_id: int) -> tuple[Invite | InviteWithMetadata, ...]
The guild's invites, with their metadata if the bot can manage the guild.
list_target_users
async
¶
The ids of the users who may see and accept the invite.
update_target_users
async
¶
update_target_users(code: str, /, **options: Unpack[InviteUpdateTargetUsers]) -> None
Replace who may accept the invite with the users of a CSV file.
bostie.rest.lobbies
¶
LobbyMemberAdd
¶
LobbyMemberSet
¶
LobbyMemberUpdate
¶
LobbyCreate
¶
LobbyCreateOrJoin
¶
LobbySendMessage
¶
Lobbies
¶
Lobbies(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
Bases: ResourceGroup
add_member
async
¶
add_member(lobby_id: int, user_id: int, /, **options: Unpack[LobbyMemberAdd]) -> LobbyMember
Add the user to the lobby, or update the member already in it.
bulk_update_members
async
¶
bulk_update_members(lobby_id: int, /, members: Sequence[LobbyMemberUpdate]) -> tuple[LobbyMember, ...]
Add, update or, with remove_member, remove up to 25 members at once.
create
async
¶
create(**options: Unpack[LobbyCreate]) -> Lobby
Create a lobby, which Social SDK clients cannot join or leave themselves.
create_invite_for_user
async
¶
A one-hour, single-use invite code to the lobby's linked channel.
edit
async
¶
edit(lobby_id: int, /, **options: Unpack[LobbyCreate]) -> Lobby
Change the lobby; members replaces every member.
BearerLobbies
¶
BearerLobbies(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
Bases: ResourceGroup
create_invite_for_self
async
¶
A one-hour, single-use invite code to the lobby's linked channel.
create_or_join
async
¶
create_or_join(**options: Unpack[LobbyCreateOrJoin]) -> Lobby
Join the lobby that has secret, or create it.
list_messages
async
¶
list_messages(lobby_id: int, /, **options: Unpack[LobbyListMessages]) -> tuple[LobbyMessage, ...]
The latest messages, 50 unless limit says up to 200.
send_message
async
¶
send_message(lobby_id: int, /, content: str, **options: Unpack[LobbySendMessage]) -> LobbyMessage
bostie.rest.members
¶
MemberAdd
¶
MemberEditCurrent
¶
MemberList
¶
MemberSearch
¶
Members
¶
Members(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
Bases: ResourceGroup
add
async
¶
Add a user with their OAuth2 token; None if they were already a member.
add_role
async
¶
edit
async
¶
edit(guild_id: int, user_id: int, /, *, reason: str | None = None, **options: Unpack[MemberEdit]) -> Member
edit_current
async
¶
edit_current(guild_id: int, /, *, reason: str | None = None, **options: Unpack[MemberEditCurrent]) -> Member
fetch_permissions
async
¶
fetch_permissions(guild_id: int, user_id: int) -> Permissions
The member's guild permissions from their roles and @everyone.
list
¶
list(guild_id: int, /, **options: Unpack[MemberList]) -> AsyncIterator[Member]
Walk the guild's members by user id; needs the Server Members intent.
remove_role
async
¶
BearerMembers
¶
BearerMembers(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
bostie.rest.messages
¶
MessageCreate
¶
MessageList
¶
MessageBulkDelete
¶
MessageListPins
¶
MessageSearch
¶
Messages
¶
Messages(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None, deletions: set[Task[None]])
Bases: ResourceGroup
create
async
¶
create(channel_id: int, /, content: str | None = None, *, reply_to: int | None = None, delete_after: float | None = None, **parts: Unpack[MessageCreate]) -> Message
Send a message; reply_to takes the id of a message in the same channel.
delete_after deletes it that many seconds later, unless the bot stops first.
edit
async
¶
Edit a message: a part not given stays and None clears it.
With files or attachments, only the listed attachments stay.
bulk_delete
async
¶
bulk_delete(channel_id: int, /, *, reason: str | None = None, **options: Unpack[MessageBulkDelete]) -> None
purge
async
¶
purge(channel_id: int, /, *, limit: int | None = 100, check: Callable[[Message | WebhookMessage], bool] | None = None, before: int | datetime | None = None, after: int | datetime | None = None, bulk: bool = True, reason: str | None = None) -> list[Message | WebhookMessage]
Delete the deletable messages among the last limit that pass check.
list
¶
list(channel_id: int, /, **options: Unpack[MessageList]) -> AsyncIterator[Message | WebhookMessage]
Walk a channel's messages newest first, or oldest first with after.
list_pins
¶
list_pins(channel_id: int, /, **options: Unpack[MessageListPins]) -> AsyncIterator[MessagePin]
Walk a channel's pins, the latest pinned first.
search
async
¶
search(guild_id: int, /, **options: Unpack[MessageSearch]) -> MessageSearchResults
Search messages, waiting out indexing; bound it with asyncio.timeout().
bostie.rest.monetization
¶
MonetizationCreateTestEntitlement
¶
MonetizationListSubscriptions
¶
Monetization
¶
Monetization(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
Bases: ResourceGroup
create_test_entitlement
async
¶
create_test_entitlement(application_id: int, /, **options: Unpack[MonetizationCreateTestEntitlement]) -> PartialEntitlement
delete_test_entitlement
async
¶
fetch_entitlement
async
¶
fetch_entitlement(application_id: int, entitlement_id: int) -> PartialEntitlement
list_entitlements
¶
list_entitlements(application_id: int, /, **options: Unpack[MonetizationListEntitlements]) -> AsyncIterator[PartialEntitlement]
Walk the app's entitlements, active and ended, oldest first.
A test entitlement, which never ends, is a PartialEntitlement.
list_subscriptions
¶
list_subscriptions(sku_id: int, /, **options: Unpack[MonetizationListSubscriptions]) -> AsyncIterator[Subscription]
bostie.rest.oauth2
¶
OAuth2
¶
OAuth2(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
Bases: ResourceGroup
exchange_client_credentials
async
¶
exchange_client_credentials(*, client_id: int, client_secret: str, scopes: Iterable[OAuth2Scope | str]) -> AccessToken
A token for the app's owner, or its team, with scopes.
exchange_code
async
¶
exchange_code(*, client_id: int, client_secret: str, code: str, redirect_uri: str, code_verifier: str | None = None) -> AccessToken
The token for the code a user's authorization redirected with.
refresh
async
¶
refresh(*, client_id: int, client_secret: str, refresh_token: str) -> AccessToken
A new token for the authorization refresh_token belongs to.
bostie.rest.onboarding
¶
OnboardingPromptOptionData
¶
OnboardingEdit
¶
Onboarding
¶
Onboarding(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
Bases: ResourceGroup
edit
async
¶
edit(guild_id: int, /, *, reason: str | None = None, **options: Unpack[OnboardingEdit]) -> GuildOnboarding
bostie.rest.partner_sdk
¶
PartnerSDK
¶
PartnerSDK(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
Bases: ResourceGroup
create_provisional_token
async
¶
create_provisional_token(*, external_user_id: str, preferred_global_name: str | None = None) -> AccessToken
A Social SDK token for a player of the game's own account system.
exchange_child_token
async
¶
exchange_child_token(*, parent_access_token: str, child_application_id: int, parent_client_secret: str) -> AccessToken
A child game's token for a publisher's access token.
exchange_external_token
async
¶
exchange_external_token(*, client_id: int, client_secret: str, external_auth_type: str, external_auth_token: str) -> AccessToken
A Social SDK token for a token of an identity provider the app set up.
unmerge_external_account
async
¶
unmerge_external_account(*, client_id: int, client_secret: str, external_auth_type: str, external_auth_token: str) -> None
Split the Discord account from the provisional one of an identity token.
bostie.rest.polls
¶
PollListAnswerVoters
¶
Polls
¶
Polls(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
Bases: ResourceGroup
list_answer_voters
¶
list_answer_voters(channel_id: int, message_id: int, answer_id: int, /, **options: Unpack[PollListAnswerVoters]) -> AsyncIterator[User]
bostie.rest.reactions
¶
ReactionList
¶
Reactions
¶
Reactions(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
Bases: ResourceGroup
Reactions on a message; emoji_name is an emoji str, Emoji or PartialEmoji.
delete_all_for_emoji
async
¶
list
¶
list(channel_id: int, message_id: int, emoji_name: AnyEmoji, /, **options: Unpack[ReactionList]) -> AsyncIterator[User]
Walk the users who reacted with an emoji.
bostie.rest.roles
¶
Roles
¶
Roles(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
Bases: ResourceGroup
create
async
¶
create(guild_id: int, /, *, reason: str | None = None, **options: Unpack[RoleCreate]) -> Role
edit
async
¶
edit(guild_id: int, role_id: int, /, *, reason: str | None = None, **options: Unpack[RoleEdit]) -> Role
edit_positions
async
¶
edit_positions(guild_id: int, /, positions: Mapping[int, int | None], *, reason: str | None = None) -> tuple[Role, ...]
Move roles, given as role id to position; returns every role of the guild.
fetch_member_counts
async
¶
How many members hold each role, by role id, @everyone left out.
fetch_permissions
async
¶
fetch_permissions(guild_id: int, role_id: int) -> Permissions
The role's guild permissions combined with those of @everyone.
bostie.rest.scheduled_events
¶
ScheduledEventListUsers
¶
ScheduledEvents
¶
ScheduledEvents(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
Bases: ResourceGroup
create
async
¶
create(guild_id: int, /, *, reason: str | None = None, **options: Unpack[ScheduledEventCreate]) -> ScheduledEvent
edit
async
¶
edit(guild_id: int, guild_scheduled_event_id: int, /, *, reason: str | None = None, **options: Unpack[ScheduledEventEdit]) -> ScheduledEvent
Change an event; start or end it by setting its status.
fetch
async
¶
fetch(guild_id: int, guild_scheduled_event_id: int, /, **options: Unpack[ScheduledEventFetch]) -> ScheduledEvent
list
async
¶
list(guild_id: int, /, **options: Unpack[ScheduledEventList]) -> tuple[ScheduledEvent, ...]
list_users
¶
list_users(guild_id: int, guild_scheduled_event_id: int, /, **options: Unpack[ScheduledEventListUsers]) -> AsyncIterator[ScheduledEventUser]
Walk an event's subscribers by user id.
bostie.rest.soundboard
¶
SoundboardCreate
¶
SoundboardEdit
¶
SoundboardSend
¶
Soundboard
¶
Soundboard(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
Bases: ResourceGroup
create
async
¶
create(guild_id: int, /, *, reason: str | None = None, **options: Unpack[SoundboardCreate]) -> SoundboardSound
edit
async
¶
edit(guild_id: int, sound_id: int, /, *, reason: str | None = None, **options: Unpack[SoundboardEdit]) -> SoundboardSound
send
async
¶
send(channel_id: int, /, **options: Unpack[SoundboardSend]) -> None
Play a sound in the voice channel the bot is connected to.
bostie.rest.stage_instances
¶
StageInstances
¶
StageInstances(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
Bases: ResourceGroup
create
async
¶
create(*, reason: str | None = None, **options: Unpack[StageInstanceCreate]) -> StageInstance
edit
async
¶
edit(channel_id: int, /, *, reason: str | None = None, **options: Unpack[StageInstanceEdit]) -> StageInstance
bostie.rest.stickers
¶
StickerCreate
¶
StickerEdit
¶
Stickers
¶
Stickers(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
Bases: ResourceGroup
create
async
¶
create(guild_id: int, /, *, reason: str | None = None, **options: Unpack[StickerCreate]) -> Sticker
Upload a PNG, APNG, GIF or Lottie JSON file as a guild sticker.
bostie.rest.templates
¶
TemplateCreate
¶
TemplateEdit
¶
Templates
¶
Templates(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
Bases: ResourceGroup
sync
async
¶
sync(guild_id: int, code: str) -> GuildTemplate
Update the template to the guild's current state.
bostie.rest.threads
¶
ThreadStart
¶
ThreadStartFromMessage
¶
ThreadListMembers
¶
ThreadListArchived
¶
ThreadListJoinedPrivateArchived
¶
Threads
¶
Threads(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
Bases: ResourceGroup
fetch_member
async
¶
fetch_member(channel_id: int, user_id: int, /, **options: Unpack[ThreadFetchMember]) -> ThreadMember
list_joined_private_archived
¶
list_joined_private_archived(channel_id: int, /, **options: Unpack[ThreadListJoinedPrivateArchived]) -> AsyncIterator[Channel]
Walk the archived private threads the bot joined, the newest first.
list_members
¶
list_members(channel_id: int, /, **options: Unpack[ThreadListMembers]) -> AsyncIterator[ThreadMember]
Walk a thread's members, each with its guild member.
list_private_archived
¶
list_private_archived(channel_id: int, /, **options: Unpack[ThreadListArchived]) -> AsyncIterator[Channel]
Walk a channel's archived private threads, the last archived first.
list_public_archived
¶
list_public_archived(channel_id: int, /, **options: Unpack[ThreadListArchived]) -> AsyncIterator[Channel]
Walk a channel's archived public threads, the last archived first.
start
async
¶
start(channel_id: int, /, *, reason: str | None = None, **options: Unpack[ThreadStart]) -> Channel
Start a thread without a message, private unless type says otherwise.
bostie.rest.users
¶
UserEditCurrent
¶
UserUpdateRoleConnection
¶
Users
¶
Users(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
Bases: _CurrentUser
BearerUsers
¶
BearerUsers(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
Bases: _CurrentUser
fetch_role_connection
async
¶
fetch_role_connection(application_id: int) -> ApplicationRoleConnection
update_role_connection
async
¶
update_role_connection(application_id: int, /, **options: Unpack[UserUpdateRoleConnection]) -> ApplicationRoleConnection
Set the user's linked role values; metadata maps each key to a string.
bostie.rest.voice
¶
VoiceEditCurrentState
¶
VoiceEditState
¶
Voice
¶
Voice(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
Bases: ResourceGroup
edit_current_state
async
¶
edit_current_state(guild_id: int, /, **options: Unpack[VoiceEditCurrentState]) -> None
Change the bot's suppress state or request to speak in a stage channel.
edit_state
async
¶
edit_state(guild_id: int, user_id: int, /, **options: Unpack[VoiceEditState]) -> None
Change a user's suppress state in a stage channel.
list_guild_regions
async
¶
list_guild_regions(guild_id: int) -> tuple[VoiceRegion, ...]
The guild's voice regions, VIP ones included when the guild has them.
bostie.rest.webhooks
¶
WebhookCreate
¶
WebhookEdit
¶
WebhookEditWithToken
¶
WebhookExecute
¶
WebhookEditMessage
¶
WebhookExecuteCompatible
¶
Webhooks
¶
Webhooks(http: HTTPClient, allowed_mentions: AllowedMentions, cache: Cache | None)
Bases: ResourceGroup
create
async
¶
create(channel_id: int, /, *, reason: str | None = None, **options: Unpack[WebhookCreate]) -> Webhook
delete_message
async
¶
delete_message(webhook_id: int, webhook_token: str, message_id: int, /, **options: Unpack[WebhookMessageIn]) -> None
edit
async
¶
edit(webhook_id: int, /, *, reason: str | None = None, **options: Unpack[WebhookEdit]) -> Webhook
edit_message
async
¶
edit_message(webhook_id: int, webhook_token: str, message_id: int, /, **parts: Unpack[WebhookEditMessage]) -> WebhookMessage
Edit a message the webhook sent: a part not given stays and None clears it.
With files or attachments, only the listed attachments stay.
edit_with_token
async
¶
edit_with_token(webhook_id: int, webhook_token: str, /, **options: Unpack[WebhookEditWithToken]) -> Webhook
execute
async
¶
execute(webhook_id: int, webhook_token: str, /, content: str | None = None, **parts: Unpack[WebhookExecute]) -> WebhookMessage
Send a message through the webhook and return it once Discord saved it.
execute_github
async
¶
execute_github(webhook_id: int, webhook_token: str, /, payload: Mapping[str, Any], **options: Unpack[WebhookExecuteCompatible]) -> None
Post a GitHub webhook event payload, as GitHub would.
execute_slack
async
¶
execute_slack(webhook_id: int, webhook_token: str, /, payload: Mapping[str, Any], **options: Unpack[WebhookExecuteCompatible]) -> None
Post a message in Slack's incoming webhook format.
fetch_message
async
¶
fetch_message(webhook_id: int, webhook_token: str, message_id: int, /, **options: Unpack[WebhookMessageIn]) -> WebhookMessage