gaato/discord/http does not have a README file
pub struct ApplicationEmojiRef {
// private fields
}async fn ApplicationEmojiRef::edit(self : ApplicationEmojiRef, name : String) -> Emoji raise DiscordHttpErrorpub struct ApplicationRef {
// private fields
}async fn ApplicationRef::activity_instance(self : ApplicationRef, instance_id : String) -> ActivityInstance raise DiscordHttpErrorasync fn ApplicationRef::bulk_overwrite_global_commands(self : ApplicationRef, commands : Json) -> Array[ApplicationCommand] raise DiscordHttpErrorasync fn ApplicationRef::bulk_overwrite_guild_commands(self : ApplicationRef, guild_id : Id[GuildMarker], commands : Json) -> Array[ApplicationCommand] raise DiscordHttpErrorasync fn ApplicationRef::create_emoji(self : ApplicationRef, name : String, image : String) -> Emoji raise DiscordHttpErrorasync fn ApplicationRef::create_global_command(self : ApplicationRef, name : String, description? : String, options? : Array[CommandOption], typ? : ApplicationCommandType, default_member_permissions? : Permissions, clear_default_member_permissions? : Bool, nsfw? : Bool, name_localizations? : Map[String, String], description_localizations? : Map[String, String], integration_types? : Array[ApplicationIntegrationType], contexts? : Array[InteractionContextType], handler? : EntryPointCommandHandlerType) -> ApplicationCommand raise DiscordHttpErrorasync fn ApplicationRef::create_guild_command(self : ApplicationRef, guild_id : Id[GuildMarker], name : String, description? : String, options? : Array[CommandOption], typ? : ApplicationCommandType, default_member_permissions? : Permissions, clear_default_member_permissions? : Bool, nsfw? : Bool, name_localizations? : Map[String, String], description_localizations? : Map[String, String]) -> ApplicationCommand raise DiscordHttpErrorasync fn ApplicationRef::create_test_entitlement(self : ApplicationRef, sku_id : Id[SkuMarker], owner_id : Id[GenericMarker], owner_type : EntitlementOwnerType) -> Entitlement raise DiscordHttpErrorfn ApplicationRef::emoji_ref(self : ApplicationRef, emoji_id : Id[EmojiMarker]) -> ApplicationEmojiReffn ApplicationRef::entitlement_ref(self : ApplicationRef, entitlement_id : Id[EntitlementMarker]) -> EntitlementRefasync fn ApplicationRef::entitlements(self : ApplicationRef, user_id? : Id[UserMarker], sku_ids? : Array[Id[SkuMarker]], before? : Id[EntitlementMarker], after? : Id[EntitlementMarker], limit? : Int, guild_id? : Id[GuildMarker], exclude_ended? : Bool, exclude_deleted? : Bool) -> Array[Entitlement] raise DiscordHttpErrorfn ApplicationRef::global_command_ref(self : ApplicationRef, command_id : Id[CommandMarker]) -> GlobalCommandRefasync fn ApplicationRef::global_commands(self : ApplicationRef, with_localizations? : Bool) -> Array[ApplicationCommand] raise DiscordHttpErrorasync fn ApplicationRef::guild_command_permissions(self : ApplicationRef, guild_id : Id[GuildMarker]) -> Array[GuildApplicationCommandPermissions] raise DiscordHttpErrorfn ApplicationRef::guild_command_ref(self : ApplicationRef, guild_id : Id[GuildMarker], command_id : Id[CommandMarker]) -> GuildCommandRefasync fn ApplicationRef::guild_commands(self : ApplicationRef, guild_id : Id[GuildMarker], with_localizations? : Bool) -> Array[ApplicationCommand] raise DiscordHttpErrorasync fn ApplicationRef::role_connection_metadata(self : ApplicationRef) -> Array[ApplicationRoleConnectionMetadata] raise DiscordHttpErrorasync fn ApplicationRef::update_role_connection_metadata(self : ApplicationRef, records : Array[ApplicationRoleConnectionMetadata]) -> Array[ApplicationRoleConnectionMetadata] raise DiscordHttpErrorpub struct AutoModerationRuleRef {
// private fields
}async fn AutoModerationRuleRef::delete(self : AutoModerationRuleRef, reason? : String) -> Unit raise DiscordHttpErrorasync fn AutoModerationRuleRef::edit(self : AutoModerationRuleRef, name? : String, event_type? : AutoModerationEventType, trigger_metadata? : TriggerMetadata, actions? : Array[AutoModerationAction], enabled? : Bool, exempt_roles? : Array[Id[RoleMarker]], exempt_channels? : Array[Id[ChannelMarker]], reason? : String) -> AutoModerationRule raise DiscordHttpErrorasync fn AutoModerationRuleRef::fetch(self : AutoModerationRuleRef) -> AutoModerationRule raise DiscordHttpErrorpub struct ChannelRef {
// private fields
}async fn ChannelRef::add_thread_member(self : ChannelRef, user_id : Id[UserMarker]) -> Unit raise DiscordHttpErrorasync fn ChannelRef::bulk_delete(self : ChannelRef, messages : Array[Id[MessageMarker]], reason? : String) -> Unit raise DiscordHttpErrorasync fn ChannelRef::create_invite(self : ChannelRef, max_age? : Int, max_uses? : Int, temporary? : Bool, unique? : Bool, target_type? : InviteTargetType, target_user_id? : Id[UserMarker], target_application_id? : Id[ApplicationMarker], role_ids? : Array[Id[RoleMarker]], target_users_file? : FileUpload, reason? : String) -> Invite raise DiscordHttpErrorasync fn ChannelRef::create_stage_instance(self : ChannelRef, topic : String, privacy_level? : StagePrivacyLevel, send_start_notification? : Bool, guild_scheduled_event_id? : Id[ScheduledEventMarker], reason? : String) -> StageInstance raise DiscordHttpErrorasync fn ChannelRef::create_webhook(self : ChannelRef, name : String, avatar? : String, reason? : String) -> Webhook raise DiscordHttpErrorasync fn ChannelRef::delete_permission(self : ChannelRef, overwrite_id : Id[GenericMarker], reason? : String) -> Unit raise DiscordHttpErrorasync fn ChannelRef::delete_stage_instance(self : ChannelRef, reason? : String) -> Unit raise DiscordHttpErrorasync fn ChannelRef::edit(self : ChannelRef, name? : String, typ? : ChannelType, topic? : String, clear_topic? : Bool, nsfw? : Bool, parent_id? : Id[ChannelMarker], clear_parent_id? : Bool, rate_limit_per_user? : Int, position? : Int, bitrate? : Int, user_limit? : Int, permission_overwrites? : Array[Overwrite], rtc_region? : String, clear_rtc_region? : Bool, video_quality_mode? : VideoQualityMode, clear_video_quality_mode? : Bool, default_auto_archive_duration? : ThreadAutoArchiveDuration, available_tags? : Array[ForumTagRequest], default_reaction_emoji? : DefaultReaction, clear_default_reaction_emoji? : Bool, default_thread_rate_limit_per_user? : Int, default_sort_order? : SortOrderType, clear_default_sort_order? : Bool, default_forum_layout? : ForumLayoutType, icon? : String, flags? : ChannelFlags, archived? : Bool, auto_archive_duration? : ThreadAutoArchiveDuration, locked? : Bool, invitable? : Bool, applied_tags? : Array[Id[GenericMarker]], reason? : String) -> Channel raise DiscordHttpErrorasync fn ChannelRef::edit_permissions(self : ChannelRef, overwrite_id : Id[GenericMarker], typ : OverwriteType, allow? : Permissions, deny? : Permissions, reason? : String) -> Unit raise DiscordHttpErrorasync fn ChannelRef::edit_stage_instance(self : ChannelRef, topic? : String, privacy_level? : StagePrivacyLevel, reason? : String) -> StageInstance raise DiscordHttpErrorasync fn ChannelRef::follow(self : ChannelRef, webhook_channel_id : Id[ChannelMarker], reason? : String) -> FollowedChannel raise DiscordHttpErrorasync fn ChannelRef::group_dm_add_recipient(self : ChannelRef, user_id : Id[UserMarker], access_token : String, nick? : String) -> Unit raise DiscordHttpErrorasync fn ChannelRef::group_dm_remove_recipient(self : ChannelRef, user_id : Id[UserMarker]) -> Unit raise DiscordHttpErrorasync fn ChannelRef::joined_private_archived_threads(self : ChannelRef, before? : Id[ChannelMarker], limit? : Int) -> ArchivedThreads raise DiscordHttpErrorfn ChannelRef::messages(self : ChannelRef, before? : Id[MessageMarker], after? : Id[MessageMarker], around? : Id[MessageMarker], page_size? : Int) -> Paginator[Message] raise DiscordHttpErrorasync fn ChannelRef::pins_page(self : ChannelRef, before? : Timestamp, limit? : Int) -> ChannelPins raise DiscordHttpErrorasync fn ChannelRef::private_archived_threads(self : ChannelRef, before? : Timestamp, limit? : Int) -> ArchivedThreads raise DiscordHttpErrorasync fn ChannelRef::public_archived_threads(self : ChannelRef, before? : Timestamp, limit? : Int) -> ArchivedThreads raise DiscordHttpErrorasync fn ChannelRef::remove_thread_member(self : ChannelRef, user_id : Id[UserMarker]) -> Unit raise DiscordHttpErrorasync fn ChannelRef::send(self : ChannelRef, content? : String, embeds? : Array[Embed], components? : Array[Component], sticker_ids? : Array[Id[StickerMarker]], files? : Array[FileUpload], reply_to? : Id[MessageMarker], tts? : Bool, flags? : MessageFlags, allowed_mentions? : AllowedMentions, nonce? : Nonce, enforce_nonce? : Bool, poll? : PollCreateRequest, message_reference? : MessageReference, shared_client_theme? : SharedClientTheme) -> Message raise DiscordHttpErrorasync fn ChannelRef::send_soundboard_sound(self : ChannelRef, sound_id : Id[SoundboardSoundMarker], source_guild_id? : Id[GuildMarker]) -> Unit raise DiscordHttpErrorasync fn ChannelRef::set_voice_status(self : ChannelRef, status? : String, reason? : String) -> Unit raise DiscordHttpErrorasync fn ChannelRef::start_forum_thread(self : ChannelRef, name : String, content? : String, embeds? : Array[Embed], components? : Array[Component], sticker_ids? : Array[Id[StickerMarker]], files? : Array[FileUpload], flags? : MessageFlags, allowed_mentions? : AllowedMentions, auto_archive_duration? : ThreadAutoArchiveDuration, rate_limit_per_user? : Int, applied_tags? : Array[Id[GenericMarker]], reason? : String) -> Channel raise DiscordHttpErrorasync fn ChannelRef::start_thread(self : ChannelRef, name : String, typ? : ChannelType, auto_archive_duration? : ThreadAutoArchiveDuration, invitable? : Bool, rate_limit_per_user? : Int, reason? : String) -> Channel raise DiscordHttpErrorasync fn ChannelRef::thread_member(self : ChannelRef, user_id : Id[UserMarker], with_member? : Bool) -> ThreadMember raise DiscordHttpErrorasync fn ChannelRef::thread_members(self : ChannelRef, with_member? : Bool, after? : Id[UserMarker], limit? : Int) -> Array[ThreadMember] raise DiscordHttpErrorlet answer = channel.with_typing(() => call_llm(prompt))
channel.send(content=answer)pub struct Client {
// private fields
}fn Client::Client(token : String, base_url? : String, api_version? : Int, limiter? : &RateLimiter, max_connections? : Int, request_timeout_ms? : Int, max_retries? : Int, default_allowed_mentions? : AllowedMentions) -> Clientasync fn Client::add_guild_member(self : Client, guild_id : Id[GuildMarker], user_id : Id[UserMarker], access_token : String, nick? : String, roles? : Array[Id[RoleMarker]], mute? : Bool, deaf? : Bool) -> GuildMember? raise DiscordHttpErrorasync fn Client::add_member_role(self : Client, guild_id : Id[GuildMarker], user_id : Id[UserMarker], role_id : Id[RoleMarker], audit_reason? : String) -> Unit raise DiscordHttpErrorasync fn Client::add_thread_member(self : Client, channel_id : Id[ChannelMarker], user_id : Id[UserMarker]) -> Unit raise DiscordHttpErrorfn Client::application_emoji_ref(self : Client, application_id : Id[ApplicationMarker], emoji_id : Id[EmojiMarker]) -> ApplicationEmojiReffn Client::auto_moderation_rule_ref(self : Client, guild_id : Id[GuildMarker], rule_id : Id[AutoModerationRuleMarker]) -> AutoModerationRuleRefasync fn Client::begin_guild_prune(self : Client, guild_id : Id[GuildMarker], days? : Int, compute_prune_count? : Bool, include_roles? : Array[Id[RoleMarker]], audit_reason? : String) -> GuildPruneResult raise DiscordHttpErrorasync fn Client::bulk_delete_messages(self : Client, channel_id : Id[ChannelMarker], messages : Array[Id[MessageMarker]], audit_reason? : String) -> Unit raise DiscordHttpErrorasync fn Client::bulk_guild_ban(self : Client, guild_id : Id[GuildMarker], user_ids : Array[Id[UserMarker]], delete_message_seconds? : Int, audit_reason? : String) -> BulkBanResponse raise DiscordHttpErrorasync fn Client::bulk_overwrite_global_commands(self : Client, application_id : Id[ApplicationMarker], commands : Json) -> Array[ApplicationCommand] raise DiscordHttpErrorasync fn Client::bulk_overwrite_guild_commands(self : Client, application_id : Id[ApplicationMarker], guild_id : Id[GuildMarker], commands : Json) -> Array[ApplicationCommand] raise DiscordHttpErrorasync fn Client::consume_entitlement(self : Client, application_id : Id[ApplicationMarker], entitlement_id : Id[EntitlementMarker]) -> Unit raise DiscordHttpErrorasync fn Client::create_application_emoji(self : Client, application_id : Id[ApplicationMarker], name : String, image : String) -> Emoji raise DiscordHttpErrorasync fn Client::create_auto_moderation_rule(self : Client, guild_id : Id[GuildMarker], name : String, event_type : AutoModerationEventType, trigger_type : AutoModerationTriggerType, actions : Array[AutoModerationAction], trigger_metadata? : TriggerMetadata, enabled? : Bool, exempt_roles? : Array[Id[RoleMarker]], exempt_channels? : Array[Id[ChannelMarker]], audit_reason? : String) -> AutoModerationRule raise DiscordHttpErrorasync fn Client::create_channel_invite(self : Client, channel_id : Id[ChannelMarker], max_age? : Int, max_uses? : Int, temporary? : Bool, unique? : Bool, target_type? : InviteTargetType, target_user_id? : Id[UserMarker], target_application_id? : Id[ApplicationMarker], role_ids? : Array[Id[RoleMarker]], target_users_file? : FileUpload, audit_reason? : String) -> Invite raise DiscordHttpErrorasync fn Client::create_dm(self : Client, recipient_id : Id[UserMarker]) -> Channel raise DiscordHttpErrortest "dm helper compiles" {
async fn dm_user(
client : @http.Client,
user_id : @model.UserId,
content : String,
) -> @model.Message {
let channel = client.create_dm(user_id)
client.create_message(
channel.id,
content~,
allowed_mentions=@model.AllowedMentions::none(),
)
}
ignore(dm_user)
}async fn Client::create_followup(self : Client, application_id : Id[ApplicationMarker], token : String, content? : String, embeds? : Array[Embed], components? : Array[Component], files? : Array[FileUpload], flags? : MessageFlags, allowed_mentions? : AllowedMentions, poll? : PollCreateRequest) -> Message raise DiscordHttpErrorasync fn Client::create_global_command(self : Client, application_id : Id[ApplicationMarker], name : String, description? : String, options? : Array[CommandOption], typ? : ApplicationCommandType, default_member_permissions? : Permissions, clear_default_member_permissions? : Bool, nsfw? : Bool, name_localizations? : Map[String, String], description_localizations? : Map[String, String], integration_types? : Array[ApplicationIntegrationType], contexts? : Array[InteractionContextType], handler? : EntryPointCommandHandlerType) -> ApplicationCommand raise DiscordHttpErrorasync fn Client::create_guild_ban(self : Client, guild_id : Id[GuildMarker], user_id : Id[UserMarker], delete_message_seconds? : Int, audit_reason? : String) -> Unit raise DiscordHttpErrorasync fn Client::create_guild_channel(self : Client, guild_id : Id[GuildMarker], name : String, typ? : ChannelType, topic? : String, parent_id? : Id[ChannelMarker], position? : Int, permission_overwrites? : Array[Overwrite], nsfw? : Bool, bitrate? : Int, user_limit? : Int, rate_limit_per_user? : Int, rtc_region? : String, video_quality_mode? : VideoQualityMode, default_auto_archive_duration? : ThreadAutoArchiveDuration, available_tags? : Array[ForumTagRequest], default_reaction_emoji? : DefaultReaction, default_thread_rate_limit_per_user? : Int, default_sort_order? : SortOrderType, default_forum_layout? : ForumLayoutType, audit_reason? : String) -> Channel raise DiscordHttpErrorasync fn Client::create_guild_command(self : Client, application_id : Id[ApplicationMarker], guild_id : Id[GuildMarker], name : String, description? : String, options? : Array[CommandOption], typ? : ApplicationCommandType, default_member_permissions? : Permissions, clear_default_member_permissions? : Bool, nsfw? : Bool, name_localizations? : Map[String, String], description_localizations? : Map[String, String]) -> ApplicationCommand raise DiscordHttpErrorasync fn Client::create_guild_emoji(self : Client, guild_id : Id[GuildMarker], name : String, image : String, roles? : Array[Id[RoleMarker]], audit_reason? : String) -> Emoji raise DiscordHttpErrorasync fn Client::create_guild_from_template(self : Client, template_code : String, name : String, icon? : String) -> Guild raise DiscordHttpErrorasync fn Client::create_guild_role(self : Client, guild_id : Id[GuildMarker], name? : String, permissions? : Permissions, color? : Int, colors? : RoleColors, hoist? : Bool, icon? : String, unicode_emoji? : String, mentionable? : Bool, audit_reason? : String) -> Role raise DiscordHttpErrorasync fn Client::create_guild_scheduled_event(self : Client, guild_id : Id[GuildMarker], name : String, privacy_level : GuildScheduledEventPrivacyLevel, scheduled_start_time : Timestamp, entity_type : GuildScheduledEventEntityType, channel_id? : Id[ChannelMarker], clear_channel_id? : Bool, entity_metadata? : EntityMetadata, clear_entity_metadata? : Bool, scheduled_end_time? : Timestamp, clear_scheduled_end_time? : Bool, description? : String, image? : String, recurrence_rule? : GuildScheduledEventRecurrenceRule, audit_reason? : String) -> GuildScheduledEvent raise DiscordHttpErrorasync fn Client::create_guild_soundboard_sound(self : Client, guild_id : Id[GuildMarker], name : String, sound : String, volume? : Double, emoji_id? : Id[EmojiMarker], emoji_name? : String, audit_reason? : String) -> SoundboardSound raise DiscordHttpErrorasync fn Client::create_guild_sticker(self : Client, guild_id : Id[GuildMarker], file : FileUpload, name : String, description : String, tags : String, audit_reason? : String) -> Sticker raise DiscordHttpErrorasync fn Client::create_guild_template(self : Client, guild_id : Id[GuildMarker], name : String, description? : String) -> GuildTemplate raise DiscordHttpErrorasync fn Client::create_interaction_response(self : Client, interaction_id : Id[InteractionMarker], token : String, response : InteractionResponse, files? : Array[FileUpload]) -> Unit raise DiscordHttpErrorasync fn Client::create_interaction_response_with_callback(self : Client, interaction_id : Id[InteractionMarker], token : String, response : InteractionResponse, files? : Array[FileUpload]) -> InteractionCallbackResponse raise DiscordHttpErrorasync fn Client::create_message(self : Client, channel_id : Id[ChannelMarker], content? : String, embeds? : Array[Embed], components? : Array[Component], sticker_ids? : Array[Id[StickerMarker]], files? : Array[FileUpload], reply_to? : Id[MessageMarker], tts? : Bool, flags? : MessageFlags, allowed_mentions? : AllowedMentions, nonce? : Nonce, enforce_nonce? : Bool, poll? : PollCreateRequest, message_reference? : MessageReference, shared_client_theme? : SharedClientTheme) -> Message raise DiscordHttpErrortest "upload a file alongside message content" {
async fn send_report(
client : @http.Client,
channel_id : @model.ChannelId,
report : Bytes,
) -> @model.Message {
let file = @http.FileUpload(
"report.csv",
report,
content_type="text/csv",
description="Daily report",
)
client.create_message(channel_id, content="Report attached", files=[file])
}
ignore(send_report)
}async fn Client::create_reaction(self : Client, channel_id : Id[ChannelMarker], message_id : Id[MessageMarker], emoji : String) -> Unit raise DiscordHttpErrorasync fn Client::create_stage_instance(self : Client, channel_id : Id[ChannelMarker], topic : String, privacy_level? : StagePrivacyLevel, send_start_notification? : Bool, guild_scheduled_event_id? : Id[ScheduledEventMarker], audit_reason? : String) -> StageInstance raise DiscordHttpErrorasync fn Client::create_test_entitlement(self : Client, application_id : Id[ApplicationMarker], sku_id : Id[SkuMarker], owner_id : Id[GenericMarker], owner_type : EntitlementOwnerType) -> Entitlement raise DiscordHttpErrorasync fn Client::create_webhook(self : Client, channel_id : Id[ChannelMarker], name : String, avatar? : String, audit_reason? : String) -> Webhook raise DiscordHttpErrorasync fn Client::crosspost_message(self : Client, channel_id : Id[ChannelMarker], message_id : Id[MessageMarker]) -> Message raise DiscordHttpErrorasync fn Client::delete_all_reactions(self : Client, channel_id : Id[ChannelMarker], message_id : Id[MessageMarker]) -> Unit raise DiscordHttpErrorasync fn Client::delete_all_reactions_for_emoji(self : Client, channel_id : Id[ChannelMarker], message_id : Id[MessageMarker], emoji : String) -> Unit raise DiscordHttpErrorasync fn Client::delete_application_emoji(self : Client, application_id : Id[ApplicationMarker], emoji_id : Id[EmojiMarker]) -> Unit raise DiscordHttpErrorasync fn Client::delete_auto_moderation_rule(self : Client, guild_id : Id[GuildMarker], rule_id : Id[AutoModerationRuleMarker], audit_reason? : String) -> Unit raise DiscordHttpErrorasync fn Client::delete_channel(self : Client, channel_id : Id[ChannelMarker], audit_reason? : String) -> Channel raise DiscordHttpErrorasync fn Client::delete_channel_permission(self : Client, channel_id : Id[ChannelMarker], overwrite_id : Id[GenericMarker], audit_reason? : String) -> Unit raise DiscordHttpErrorasync fn Client::delete_current_user_application_role_connection(self : Client, application_id : Id[ApplicationMarker], bearer_token~ : String) -> Unit raise DiscordHttpErrorasync fn Client::delete_followup(self : Client, application_id : Id[ApplicationMarker], token : String, message_id : Id[MessageMarker]) -> Unit raise DiscordHttpErrorasync fn Client::delete_global_command(self : Client, application_id : Id[ApplicationMarker], command_id : Id[CommandMarker]) -> Unit raise DiscordHttpErrorasync fn Client::delete_guild_command(self : Client, application_id : Id[ApplicationMarker], guild_id : Id[GuildMarker], command_id : Id[CommandMarker]) -> Unit raise DiscordHttpErrorasync fn Client::delete_guild_emoji(self : Client, guild_id : Id[GuildMarker], emoji_id : Id[EmojiMarker], audit_reason? : String) -> Unit raise DiscordHttpErrorasync fn Client::delete_guild_integration(self : Client, guild_id : Id[GuildMarker], integration_id : Id[IntegrationMarker], audit_reason? : String) -> Unit raise DiscordHttpErrorasync fn Client::delete_guild_role(self : Client, guild_id : Id[GuildMarker], role_id : Id[RoleMarker], audit_reason? : String) -> Unit raise DiscordHttpErrorasync fn Client::delete_guild_scheduled_event(self : Client, guild_id : Id[GuildMarker], event_id : Id[ScheduledEventMarker], audit_reason? : String) -> Unit raise DiscordHttpErrorasync fn Client::delete_guild_soundboard_sound(self : Client, guild_id : Id[GuildMarker], sound_id : Id[SoundboardSoundMarker], audit_reason? : String) -> Unit raise DiscordHttpErrorasync fn Client::delete_guild_sticker(self : Client, guild_id : Id[GuildMarker], sticker_id : Id[StickerMarker], audit_reason? : String) -> Unit raise DiscordHttpErrorasync fn Client::delete_guild_template(self : Client, guild_id : Id[GuildMarker], template_code : String) -> GuildTemplate raise DiscordHttpErrorasync fn Client::delete_invite(self : Client, code : String, audit_reason? : String) -> Invite raise DiscordHttpErrorasync fn Client::delete_message(self : Client, channel_id : Id[ChannelMarker], message_id : Id[MessageMarker], audit_reason? : String) -> Unit raise DiscordHttpErrorasync fn Client::delete_original_response(self : Client, application_id : Id[ApplicationMarker], token : String) -> Unit raise DiscordHttpErrorasync fn Client::delete_own_reaction(self : Client, channel_id : Id[ChannelMarker], message_id : Id[MessageMarker], emoji : String) -> Unit raise DiscordHttpErrorasync fn Client::delete_stage_instance(self : Client, channel_id : Id[ChannelMarker], audit_reason? : String) -> Unit raise DiscordHttpErrorasync fn Client::delete_test_entitlement(self : Client, application_id : Id[ApplicationMarker], entitlement_id : Id[EntitlementMarker]) -> Unit raise DiscordHttpErrorasync fn Client::delete_user_reaction(self : Client, channel_id : Id[ChannelMarker], message_id : Id[MessageMarker], emoji : String, user_id : Id[UserMarker]) -> Unit raise DiscordHttpErrorasync fn Client::delete_webhook(self : Client, webhook_id : Id[WebhookMarker], audit_reason? : String) -> Unit raise DiscordHttpErrorasync fn Client::delete_webhook_message(self : Client, webhook_id : Id[WebhookMarker], token : String, message_id : Id[MessageMarker], thread_id? : Id[ChannelMarker]) -> Unit raise DiscordHttpErrorasync fn Client::delete_webhook_with_token(self : Client, webhook_id : Id[WebhookMarker], token : String) -> Unit raise DiscordHttpErrorasync fn Client::edit_application_command_permissions(self : Client, application_id : Id[ApplicationMarker], guild_id : Id[GuildMarker], command_id : Id[CommandMarker], permissions : Array[ApplicationCommandPermission], bearer_token~ : String) -> GuildApplicationCommandPermissions raise DiscordHttpErrorasync fn Client::edit_channel_permissions(self : Client, channel_id : Id[ChannelMarker], overwrite_id : Id[GenericMarker], typ : OverwriteType, allow? : Permissions, deny? : Permissions, audit_reason? : String) -> Unit raise DiscordHttpErrorasync fn Client::edit_current_application(self : Client, custom_install_url? : String, clear_custom_install_url? : Bool, description? : String, clear_description? : Bool, role_connections_verification_url? : String, clear_role_connections_verification_url? : Bool, install_params? : InstallParams, clear_install_params? : Bool, integration_types_config? : Map[String, ApplicationIntegrationTypeConfiguration], flags? : ApplicationFlags, icon? : String, clear_icon? : Bool, cover_image? : String, clear_cover_image? : Bool, interactions_endpoint_url? : String, clear_interactions_endpoint_url? : Bool, tags? : Array[String], clear_tags? : Bool, event_webhooks_url? : String, clear_event_webhooks_url? : Bool, event_webhooks_status? : ApplicationEventWebhookStatus, event_webhooks_types? : Array[String]) -> Application raise DiscordHttpErrorasync fn Client::edit_followup(self : Client, application_id : Id[ApplicationMarker], token : String, message_id : Id[MessageMarker], content? : String, clear_content? : Bool, embeds? : Array[Embed], components? : Array[Component], flags? : MessageFlags, allowed_mentions? : AllowedMentions, files? : Array[FileUpload], keep_attachments? : Array[AttachmentRequest]) -> Message raise DiscordHttpErrorasync fn Client::edit_global_command(self : Client, application_id : Id[ApplicationMarker], command_id : Id[CommandMarker], name? : String, description? : String, options? : Array[CommandOption], default_member_permissions? : Permissions, clear_default_member_permissions? : Bool, nsfw? : Bool, name_localizations? : Map[String, String], clear_name_localizations? : Bool, description_localizations? : Map[String, String], clear_description_localizations? : Bool, integration_types? : Array[ApplicationIntegrationType], contexts? : Array[InteractionContextType], handler? : EntryPointCommandHandlerType) -> ApplicationCommand raise DiscordHttpErrorasync fn Client::edit_guild_command(self : Client, application_id : Id[ApplicationMarker], guild_id : Id[GuildMarker], command_id : Id[CommandMarker], name? : String, description? : String, options? : Array[CommandOption], default_member_permissions? : Permissions, clear_default_member_permissions? : Bool, nsfw? : Bool, name_localizations? : Map[String, String], clear_name_localizations? : Bool, description_localizations? : Map[String, String], clear_description_localizations? : Bool) -> ApplicationCommand raise DiscordHttpErrorasync fn Client::edit_message(self : Client, channel_id : Id[ChannelMarker], message_id : Id[MessageMarker], content? : String, clear_content? : Bool, embeds? : Array[Embed], components? : Array[Component], flags? : MessageFlags, allowed_mentions? : AllowedMentions, files? : Array[FileUpload], keep_attachments? : Array[AttachmentRequest]) -> Message raise DiscordHttpErrorasync fn Client::edit_original_response(self : Client, application_id : Id[ApplicationMarker], token : String, content? : String, clear_content? : Bool, embeds? : Array[Embed], components? : Array[Component], flags? : MessageFlags, allowed_mentions? : AllowedMentions, files? : Array[FileUpload], keep_attachments? : Array[AttachmentRequest], poll? : PollCreateRequest) -> Message raise DiscordHttpErrorasync fn Client::edit_webhook_message(self : Client, webhook_id : Id[WebhookMarker], token : String, message_id : Id[MessageMarker], content? : String, clear_content? : Bool, embeds? : Array[Embed], components? : Array[Component], flags? : MessageFlags, allowed_mentions? : AllowedMentions, files? : Array[FileUpload], keep_attachments? : Array[AttachmentRequest], thread_id? : Id[ChannelMarker], with_components? : Bool) -> Message raise DiscordHttpErrorfn Client::emoji_ref(self : Client, guild_id : Id[GuildMarker], emoji_id : Id[EmojiMarker]) -> EmojiReffn Client::entitlement_ref(self : Client, application_id : Id[ApplicationMarker], entitlement_id : Id[EntitlementMarker]) -> EntitlementRefasync fn Client::execute_github_compatible_webhook(self : Client, webhook_id : Id[WebhookMarker], token : String, payload : Json, github_event~ : String, thread_id? : Id[ChannelMarker], wait? : Bool) -> Unit raise DiscordHttpErrorasync fn Client::execute_slack_compatible_webhook(self : Client, webhook_id : Id[WebhookMarker], token : String, payload : Json, thread_id? : Id[ChannelMarker], wait? : Bool) -> Unit raise DiscordHttpErrorasync fn Client::execute_webhook(self : Client, webhook_id : Id[WebhookMarker], token : String, content? : String, embeds? : Array[Embed], components? : Array[Component], files? : Array[FileUpload], username? : String, avatar_url? : String, tts? : Bool, allowed_mentions? : AllowedMentions, thread_id? : Id[ChannelMarker], thread_name? : String, applied_tags? : Array[Id[GenericMarker]], poll? : PollCreateRequest, with_components? : Bool, flags? : MessageFlags) -> Message raise DiscordHttpErrorasync fn Client::expire_poll(self : Client, channel_id : Id[ChannelMarker], message_id : Id[MessageMarker]) -> Message raise DiscordHttpErrorasync fn Client::follow_announcement_channel(self : Client, channel_id : Id[ChannelMarker], webhook_channel_id : Id[ChannelMarker], audit_reason? : String) -> FollowedChannel raise DiscordHttpErrorasync fn Client::get_application_activity_instance(self : Client, application_id : Id[ApplicationMarker], instance_id : String) -> ActivityInstance raise DiscordHttpErrorasync fn Client::get_application_command_permissions(self : Client, application_id : Id[ApplicationMarker], guild_id : Id[GuildMarker], command_id : Id[CommandMarker]) -> GuildApplicationCommandPermissions raise DiscordHttpErrorasync fn Client::get_application_emoji(self : Client, application_id : Id[ApplicationMarker], emoji_id : Id[EmojiMarker]) -> Emoji raise DiscordHttpErrorasync fn Client::get_application_role_connection_metadata_records(self : Client, application_id : Id[ApplicationMarker]) -> Array[ApplicationRoleConnectionMetadata] raise DiscordHttpErrorasync fn Client::get_auto_moderation_rule(self : Client, guild_id : Id[GuildMarker], rule_id : Id[AutoModerationRuleMarker]) -> AutoModerationRule raise DiscordHttpErrorasync fn Client::get_channel(self : Client, channel_id : Id[ChannelMarker]) -> Channel raise DiscordHttpErrorasync fn Client::get_channel_invites(self : Client, channel_id : Id[ChannelMarker]) -> Array[Invite] raise DiscordHttpErrorasync fn Client::get_channel_messages(self : Client, channel_id : Id[ChannelMarker], limit? : Int, around? : Id[MessageMarker], before? : Id[MessageMarker], after? : Id[MessageMarker]) -> Array[Message] raise DiscordHttpErrorasync fn Client::get_channel_pins(self : Client, channel_id : Id[ChannelMarker], before? : Timestamp, limit? : Int) -> ChannelPins raise DiscordHttpErrorasync fn Client::get_channel_webhooks(self : Client, channel_id : Id[ChannelMarker]) -> Array[Webhook] raise DiscordHttpErrorasync fn Client::get_current_authorization_information(self : Client, bearer_token~ : String) -> AuthorizationInformation raise DiscordHttpErrorasync fn Client::get_current_bot_application_information(self : Client) -> Application raise DiscordHttpErrorasync fn Client::get_current_user_application_role_connection(self : Client, application_id : Id[ApplicationMarker], bearer_token~ : String) -> ApplicationRoleConnection raise DiscordHttpErrorasync fn Client::get_current_user_connections(self : Client, bearer_token~ : String) -> Array[Connection] raise DiscordHttpErrorasync fn Client::get_current_user_guild_member(self : Client, guild_id : Id[GuildMarker], bearer_token~ : String) -> GuildMember raise DiscordHttpErrorasync fn Client::get_current_user_guilds(self : Client, limit? : Int, before? : Id[GuildMarker], after? : Id[GuildMarker], with_counts? : Bool) -> Array[CurrentUserGuild] raise DiscordHttpErrorasync fn Client::get_current_user_voice_state(self : Client, guild_id : Id[GuildMarker]) -> VoiceState raise DiscordHttpErrorasync fn Client::get_entitlement(self : Client, application_id : Id[ApplicationMarker], entitlement_id : Id[EntitlementMarker]) -> Entitlement raise DiscordHttpErrorasync fn Client::get_followup(self : Client, application_id : Id[ApplicationMarker], token : String, message_id : Id[MessageMarker]) -> Message raise DiscordHttpErrorasync fn Client::get_global_command(self : Client, application_id : Id[ApplicationMarker], command_id : Id[CommandMarker]) -> ApplicationCommand raise DiscordHttpErrorasync fn Client::get_global_commands(self : Client, application_id : Id[ApplicationMarker], with_localizations? : Bool) -> Array[ApplicationCommand] raise DiscordHttpErrorasync fn Client::get_guild(self : Client, guild_id : Id[GuildMarker], with_counts? : Bool) -> Guild raise DiscordHttpErrorasync fn Client::get_guild_application_command_permissions(self : Client, application_id : Id[ApplicationMarker], guild_id : Id[GuildMarker]) -> Array[GuildApplicationCommandPermissions] raise DiscordHttpErrorasync fn Client::get_guild_audit_log(self : Client, guild_id : Id[GuildMarker], user_id? : Id[UserMarker], action_type? : AuditLogEvent, before? : Id[AuditLogEntryMarker], after? : Id[AuditLogEntryMarker], limit? : Int) -> AuditLog raise DiscordHttpErrorasync fn Client::get_guild_ban(self : Client, guild_id : Id[GuildMarker], user_id : Id[UserMarker]) -> GuildBan raise DiscordHttpErrorasync fn Client::get_guild_bans(self : Client, guild_id : Id[GuildMarker], limit? : Int, before? : Id[UserMarker], after? : Id[UserMarker]) -> Array[GuildBan] raise DiscordHttpErrorasync fn Client::get_guild_channels(self : Client, guild_id : Id[GuildMarker]) -> Array[Channel] raise DiscordHttpErrorasync fn Client::get_guild_command(self : Client, application_id : Id[ApplicationMarker], guild_id : Id[GuildMarker], command_id : Id[CommandMarker]) -> ApplicationCommand raise DiscordHttpErrorasync fn Client::get_guild_commands(self : Client, application_id : Id[ApplicationMarker], guild_id : Id[GuildMarker], with_localizations? : Bool) -> Array[ApplicationCommand] raise DiscordHttpErrorasync fn Client::get_guild_emoji(self : Client, guild_id : Id[GuildMarker], emoji_id : Id[EmojiMarker]) -> Emoji raise DiscordHttpErrorasync fn Client::get_guild_integrations(self : Client, guild_id : Id[GuildMarker]) -> Array[Integration] raise DiscordHttpErrorasync fn Client::get_guild_invites(self : Client, guild_id : Id[GuildMarker]) -> Array[Invite] raise DiscordHttpErrorasync fn Client::get_guild_member(self : Client, guild_id : Id[GuildMarker], user_id : Id[UserMarker]) -> GuildMember raise DiscordHttpErrorasync fn Client::get_guild_onboarding(self : Client, guild_id : Id[GuildMarker]) -> GuildOnboarding raise DiscordHttpErrorasync fn Client::get_guild_preview(self : Client, guild_id : Id[GuildMarker]) -> GuildPreview raise DiscordHttpErrorasync fn Client::get_guild_prune_count(self : Client, guild_id : Id[GuildMarker], days? : Int, include_roles? : Array[Id[RoleMarker]]) -> GuildPruneResult raise DiscordHttpErrorasync fn Client::get_guild_role(self : Client, guild_id : Id[GuildMarker], role_id : Id[RoleMarker]) -> Role raise DiscordHttpErrorasync fn Client::get_guild_roles(self : Client, guild_id : Id[GuildMarker]) -> Array[Role] raise DiscordHttpErrorasync fn Client::get_guild_scheduled_event(self : Client, guild_id : Id[GuildMarker], event_id : Id[ScheduledEventMarker], with_user_count? : Bool) -> GuildScheduledEvent raise DiscordHttpErrorasync fn Client::get_guild_soundboard_sound(self : Client, guild_id : Id[GuildMarker], sound_id : Id[SoundboardSoundMarker]) -> SoundboardSound raise DiscordHttpErrorasync fn Client::get_guild_sticker(self : Client, guild_id : Id[GuildMarker], sticker_id : Id[StickerMarker]) -> Sticker raise DiscordHttpErrorasync fn Client::get_guild_template(self : Client, template_code : String) -> GuildTemplate raise DiscordHttpErrorasync fn Client::get_guild_templates(self : Client, guild_id : Id[GuildMarker]) -> Array[GuildTemplate] raise DiscordHttpErrorasync fn Client::get_guild_vanity_url(self : Client, guild_id : Id[GuildMarker]) -> GuildVanityUrl raise DiscordHttpErrorasync fn Client::get_guild_voice_regions(self : Client, guild_id : Id[GuildMarker]) -> Array[VoiceRegion] raise DiscordHttpErrorasync fn Client::get_guild_webhooks(self : Client, guild_id : Id[GuildMarker]) -> Array[Webhook] raise DiscordHttpErrorasync fn Client::get_guild_welcome_screen(self : Client, guild_id : Id[GuildMarker]) -> WelcomeScreen raise DiscordHttpErrorasync fn Client::get_guild_widget(self : Client, guild_id : Id[GuildMarker]) -> GuildWidget raise DiscordHttpErrorasync fn Client::get_guild_widget_settings(self : Client, guild_id : Id[GuildMarker]) -> GuildWidgetSettings raise DiscordHttpErrorasync fn Client::get_invite(self : Client, code : String, with_counts? : Bool, guild_scheduled_event_id? : Id[ScheduledEventMarker]) -> Invite raise DiscordHttpErrorasync fn Client::get_invite_target_users_job_status(self : Client, code : String) -> TargetUsersJobStatus raise DiscordHttpErrorasync fn Client::get_message(self : Client, channel_id : Id[ChannelMarker], message_id : Id[MessageMarker]) -> Message raise DiscordHttpErrorasync fn Client::get_original_response(self : Client, application_id : Id[ApplicationMarker], token : String) -> Message raise DiscordHttpErrorasync fn Client::get_pinned_messages(self : Client, channel_id : Id[ChannelMarker]) -> Array[Message] raise DiscordHttpErrorasync fn Client::get_poll_answer_voters(self : Client, channel_id : Id[ChannelMarker], message_id : Id[MessageMarker], answer_id : Int, after? : Id[UserMarker], limit? : Int) -> PollAnswerVoters raise DiscordHttpErrorasync fn Client::get_reactions(self : Client, channel_id : Id[ChannelMarker], message_id : Id[MessageMarker], emoji : String, typ? : ReactionType, limit? : Int, after? : Id[UserMarker]) -> Array[User] raise DiscordHttpErrorasync fn Client::get_sku_subscription(self : Client, sku_id : Id[SkuMarker], subscription_id : Id[SubscriptionMarker]) -> Subscription raise DiscordHttpErrorasync fn Client::get_stage_instance(self : Client, channel_id : Id[ChannelMarker]) -> StageInstance raise DiscordHttpErrorasync fn Client::get_sticker(self : Client, sticker_id : Id[StickerMarker]) -> Sticker raise DiscordHttpErrorasync fn Client::get_sticker_pack(self : Client, pack_id : Id[StickerPackMarker]) -> StickerPack raise DiscordHttpErrorasync fn Client::get_thread_member(self : Client, channel_id : Id[ChannelMarker], user_id : Id[UserMarker], with_member? : Bool) -> ThreadMember raise DiscordHttpErrorasync fn Client::get_user_voice_state(self : Client, guild_id : Id[GuildMarker], user_id : Id[UserMarker]) -> VoiceState raise DiscordHttpErrorasync fn Client::get_webhook(self : Client, webhook_id : Id[WebhookMarker]) -> Webhook raise DiscordHttpErrorasync fn Client::get_webhook_message(self : Client, webhook_id : Id[WebhookMarker], token : String, message_id : Id[MessageMarker], thread_id? : Id[ChannelMarker]) -> Message raise DiscordHttpErrorasync fn Client::get_webhook_with_token(self : Client, webhook_id : Id[WebhookMarker], token : String) -> Webhook raise DiscordHttpErrorfn Client::global_command_ref(self : Client, application_id : Id[ApplicationMarker], command_id : Id[CommandMarker]) -> GlobalCommandRefasync fn Client::group_dm_add_recipient(self : Client, channel_id : Id[ChannelMarker], user_id : Id[UserMarker], access_token : String, nick? : String) -> Unit raise DiscordHttpErrorasync fn Client::group_dm_remove_recipient(self : Client, channel_id : Id[ChannelMarker], user_id : Id[UserMarker]) -> Unit raise DiscordHttpErrorfn Client::guild_command_ref(self : Client, application_id : Id[ApplicationMarker], guild_id : Id[GuildMarker], command_id : Id[CommandMarker]) -> GuildCommandReffn Client::guild_template_ref(self : Client, guild_id : Id[GuildMarker], code : String) -> TemplateReffn Client::guild_widget_image_url(self : Client, guild_id : Id[GuildMarker], style? : String) -> Stringasync fn Client::join_thread(self : Client, channel_id : Id[ChannelMarker]) -> Unit raise DiscordHttpErrorasync fn Client::leave_guild(self : Client, guild_id : Id[GuildMarker]) -> Unit raise DiscordHttpErrorasync fn Client::leave_thread(self : Client, channel_id : Id[ChannelMarker]) -> Unit raise DiscordHttpErrorasync fn Client::list_active_guild_threads(self : Client, guild_id : Id[GuildMarker]) -> ActiveGuildThreads raise DiscordHttpErrorasync fn Client::list_application_emojis(self : Client, application_id : Id[ApplicationMarker]) -> Array[Emoji] raise DiscordHttpErrorasync fn Client::list_auto_moderation_rules(self : Client, guild_id : Id[GuildMarker]) -> Array[AutoModerationRule] raise DiscordHttpErrorasync fn Client::list_default_soundboard_sounds(self : Client) -> Array[SoundboardSound] raise DiscordHttpErrorasync fn Client::list_entitlements(self : Client, application_id : Id[ApplicationMarker], user_id? : Id[UserMarker], sku_ids? : Array[Id[SkuMarker]], before? : Id[EntitlementMarker], after? : Id[EntitlementMarker], limit? : Int, guild_id? : Id[GuildMarker], exclude_ended? : Bool, exclude_deleted? : Bool) -> Array[Entitlement] raise DiscordHttpErrorasync fn Client::list_guild_emojis(self : Client, guild_id : Id[GuildMarker]) -> Array[Emoji] raise DiscordHttpErrorasync fn Client::list_guild_members(self : Client, guild_id : Id[GuildMarker], limit? : Int, after? : Id[UserMarker]) -> Array[GuildMember] raise DiscordHttpErrorasync fn Client::list_guild_scheduled_event_users(self : Client, guild_id : Id[GuildMarker], event_id : Id[ScheduledEventMarker], limit? : Int, with_member? : Bool, before? : Id[UserMarker], after? : Id[UserMarker]) -> Array[GuildScheduledEventUser] raise DiscordHttpErrorasync fn Client::list_guild_scheduled_events(self : Client, guild_id : Id[GuildMarker], with_user_count? : Bool) -> Array[GuildScheduledEvent] raise DiscordHttpErrorasync fn Client::list_guild_soundboard_sounds(self : Client, guild_id : Id[GuildMarker]) -> Array[SoundboardSound] raise DiscordHttpErrorasync fn Client::list_guild_stickers(self : Client, guild_id : Id[GuildMarker]) -> Array[Sticker] raise DiscordHttpErrorasync fn Client::list_joined_private_archived_threads(self : Client, channel_id : Id[ChannelMarker], before? : Id[ChannelMarker], limit? : Int) -> ArchivedThreads raise DiscordHttpErrorasync fn Client::list_private_archived_threads(self : Client, channel_id : Id[ChannelMarker], before? : Timestamp, limit? : Int) -> ArchivedThreads raise DiscordHttpErrorasync fn Client::list_public_archived_threads(self : Client, channel_id : Id[ChannelMarker], before? : Timestamp, limit? : Int) -> ArchivedThreads raise DiscordHttpErrorasync fn Client::list_sku_subscriptions(self : Client, sku_id : Id[SkuMarker], before? : Id[SubscriptionMarker], after? : Id[SubscriptionMarker], limit? : Int, user_id? : Id[UserMarker]) -> Array[Subscription] raise DiscordHttpErrorasync fn Client::list_skus(self : Client, application_id : Id[ApplicationMarker]) -> Array[Sku] raise DiscordHttpErrorasync fn Client::list_thread_members(self : Client, channel_id : Id[ChannelMarker], with_member? : Bool, after? : Id[UserMarker], limit? : Int) -> Array[ThreadMember] raise DiscordHttpErrorfn Client::member_ref(self : Client, guild_id : Id[GuildMarker], user_id : Id[UserMarker]) -> MemberReffn Client::message_ref(self : Client, channel_id : Id[ChannelMarker], message_id : Id[MessageMarker]) -> MessageReffn Client::middleware(self : Client, middleware : async (HttpRequest, async (HttpRequest) -> HttpResponse) -> HttpResponse) -> Unitasync fn Client::modify_application_emoji(self : Client, application_id : Id[ApplicationMarker], emoji_id : Id[EmojiMarker], name : String) -> Emoji raise DiscordHttpErrorasync fn Client::modify_auto_moderation_rule(self : Client, guild_id : Id[GuildMarker], rule_id : Id[AutoModerationRuleMarker], name? : String, event_type? : AutoModerationEventType, trigger_metadata? : TriggerMetadata, actions? : Array[AutoModerationAction], enabled? : Bool, exempt_roles? : Array[Id[RoleMarker]], exempt_channels? : Array[Id[ChannelMarker]], audit_reason? : String) -> AutoModerationRule raise DiscordHttpErrorasync fn Client::modify_channel(self : Client, channel_id : Id[ChannelMarker], name? : String, typ? : ChannelType, topic? : String, clear_topic? : Bool, nsfw? : Bool, parent_id? : Id[ChannelMarker], clear_parent_id? : Bool, rate_limit_per_user? : Int, position? : Int, bitrate? : Int, user_limit? : Int, permission_overwrites? : Array[Overwrite], rtc_region? : String, clear_rtc_region? : Bool, video_quality_mode? : VideoQualityMode, clear_video_quality_mode? : Bool, default_auto_archive_duration? : ThreadAutoArchiveDuration, available_tags? : Array[ForumTagRequest], default_reaction_emoji? : DefaultReaction, clear_default_reaction_emoji? : Bool, default_thread_rate_limit_per_user? : Int, default_sort_order? : SortOrderType, clear_default_sort_order? : Bool, default_forum_layout? : ForumLayoutType, icon? : String, flags? : ChannelFlags, archived? : Bool, auto_archive_duration? : ThreadAutoArchiveDuration, locked? : Bool, invitable? : Bool, applied_tags? : Array[Id[GenericMarker]], audit_reason? : String) -> Channel raise DiscordHttpErrorasync fn Client::modify_current_member(self : Client, guild_id : Id[GuildMarker], nick? : String, clear_nick? : Bool, avatar? : String, clear_avatar? : Bool, banner? : String, clear_banner? : Bool, bio? : String, clear_bio? : Bool, audit_reason? : String) -> GuildMember raise DiscordHttpErrorasync fn Client::modify_current_user(self : Client, username? : String, avatar? : String, clear_avatar? : Bool, banner? : String, clear_banner? : Bool) -> User raise DiscordHttpErrorasync fn Client::modify_current_user_voice_state(self : Client, guild_id : Id[GuildMarker], channel_id? : Id[ChannelMarker], suppress? : Bool, request_to_speak_timestamp? : Timestamp, clear_request_to_speak_timestamp? : Bool) -> Unit raise DiscordHttpErrorasync fn Client::modify_guild(self : Client, guild_id : Id[GuildMarker], name? : String, verification_level? : VerificationLevel, default_message_notifications? : DefaultMessageNotifications, explicit_content_filter? : ExplicitContentFilter, afk_channel_id? : Id[ChannelMarker], clear_afk_channel_id? : Bool, afk_timeout? : Int, icon? : String, clear_icon? : Bool, owner_id? : Id[UserMarker], splash? : String, clear_splash? : Bool, discovery_splash? : String, clear_discovery_splash? : Bool, banner? : String, clear_banner? : Bool, system_channel_id? : Id[ChannelMarker], clear_system_channel_id? : Bool, system_channel_flags? : SystemChannelFlags, rules_channel_id? : Id[ChannelMarker], clear_rules_channel_id? : Bool, public_updates_channel_id? : Id[ChannelMarker], clear_public_updates_channel_id? : Bool, preferred_locale? : String, features? : Array[GuildFeature], description? : String, clear_description? : Bool, premium_progress_bar_enabled? : Bool, safety_alerts_channel_id? : Id[ChannelMarker], clear_safety_alerts_channel_id? : Bool, audit_reason? : String) -> Guild raise DiscordHttpErrorasync fn Client::modify_guild_channel_positions(self : Client, guild_id : Id[GuildMarker], positions : Array[GuildChannelPosition], audit_reason? : String) -> Unit raise DiscordHttpErrorasync fn Client::modify_guild_emoji(self : Client, guild_id : Id[GuildMarker], emoji_id : Id[EmojiMarker], name? : String, roles? : Array[Id[RoleMarker]], audit_reason? : String) -> Emoji raise DiscordHttpErrorasync fn Client::modify_guild_incident_actions(self : Client, guild_id : Id[GuildMarker], invites_disabled_until? : Timestamp, clear_invites_disabled_until? : Bool, dms_disabled_until? : Timestamp, clear_dms_disabled_until? : Bool) -> IncidentsData raise DiscordHttpErrorasync fn Client::modify_guild_member(self : Client, guild_id : Id[GuildMarker], user_id : Id[UserMarker], nick? : String, clear_nick? : Bool, roles? : Array[Id[RoleMarker]], mute? : Bool, deaf? : Bool, channel_id? : Id[ChannelMarker], clear_channel_id? : Bool, communication_disabled_until? : Timestamp, clear_communication_disabled_until? : Bool, flags? : GuildMemberFlags, audit_reason? : String) -> GuildMember raise DiscordHttpErrorasync fn Client::modify_guild_onboarding(self : Client, guild_id : Id[GuildMarker], prompts : Array[OnboardingPrompt], default_channel_ids : Array[Id[ChannelMarker]], enabled : Bool, mode : OnboardingMode, audit_reason? : String) -> GuildOnboarding raise DiscordHttpErrorasync fn Client::modify_guild_role(self : Client, guild_id : Id[GuildMarker], role_id : Id[RoleMarker], name? : String, permissions? : Permissions, color? : Int, colors? : RoleColors, hoist? : Bool, icon? : String, clear_icon? : Bool, unicode_emoji? : String, clear_unicode_emoji? : Bool, mentionable? : Bool, audit_reason? : String) -> Role raise DiscordHttpErrorasync fn Client::modify_guild_role_positions(self : Client, guild_id : Id[GuildMarker], positions : Array[(Id[RoleMarker], Int?)], audit_reason? : String) -> Array[Role] raise DiscordHttpErrorasync fn Client::modify_guild_scheduled_event(self : Client, guild_id : Id[GuildMarker], event_id : Id[ScheduledEventMarker], channel_id? : Id[ChannelMarker], clear_channel_id? : Bool, entity_metadata? : EntityMetadata, clear_entity_metadata? : Bool, name? : String, privacy_level? : GuildScheduledEventPrivacyLevel, scheduled_start_time? : Timestamp, scheduled_end_time? : Timestamp, clear_scheduled_end_time? : Bool, description? : String, clear_description? : Bool, entity_type? : GuildScheduledEventEntityType, status? : GuildScheduledEventStatus, image? : String, clear_image? : Bool, recurrence_rule? : GuildScheduledEventRecurrenceRule, clear_recurrence_rule? : Bool, audit_reason? : String) -> GuildScheduledEvent raise DiscordHttpErrorasync fn Client::modify_guild_soundboard_sound(self : Client, guild_id : Id[GuildMarker], sound_id : Id[SoundboardSoundMarker], name? : String, volume? : Double, emoji_id? : Id[EmojiMarker], clear_emoji_id? : Bool, emoji_name? : String, clear_emoji_name? : Bool, audit_reason? : String) -> SoundboardSound raise DiscordHttpErrorasync fn Client::modify_guild_sticker(self : Client, guild_id : Id[GuildMarker], sticker_id : Id[StickerMarker], name? : String, description? : String, clear_description? : Bool, tags? : String, audit_reason? : String) -> Sticker raise DiscordHttpErrorasync fn Client::modify_guild_template(self : Client, guild_id : Id[GuildMarker], template_code : String, name? : String, description? : String, clear_description? : Bool) -> GuildTemplate raise DiscordHttpErrorasync fn Client::modify_guild_welcome_screen(self : Client, guild_id : Id[GuildMarker], enabled? : Bool, clear_enabled? : Bool, welcome_channels? : Array[WelcomeScreenChannel], clear_welcome_channels? : Bool, description? : String, clear_description? : Bool, audit_reason? : String) -> WelcomeScreen raise DiscordHttpErrorasync fn Client::modify_guild_widget(self : Client, guild_id : Id[GuildMarker], enabled? : Bool, channel_id? : Id[ChannelMarker], clear_channel_id? : Bool, audit_reason? : String) -> GuildWidgetSettings raise DiscordHttpErrorasync fn Client::modify_stage_instance(self : Client, channel_id : Id[ChannelMarker], topic? : String, privacy_level? : StagePrivacyLevel, audit_reason? : String) -> StageInstance raise DiscordHttpErrorasync fn Client::modify_user_voice_state(self : Client, guild_id : Id[GuildMarker], user_id : Id[UserMarker], channel_id : Id[ChannelMarker], suppress? : Bool) -> Unit raise DiscordHttpErrorasync fn Client::modify_webhook(self : Client, webhook_id : Id[WebhookMarker], name? : String, avatar? : String, clear_avatar? : Bool, channel_id? : Id[ChannelMarker], audit_reason? : String) -> Webhook raise DiscordHttpErrorasync fn Client::modify_webhook_with_token(self : Client, webhook_id : Id[WebhookMarker], token : String, name? : String, avatar? : String, clear_avatar? : Bool) -> Webhook raise DiscordHttpErrorfn Client::paginate_current_user_guilds(self : Client, before? : Id[GuildMarker], after? : Id[GuildMarker], with_counts? : Bool, page_size? : Int) -> Paginator[CurrentUserGuild] raise DiscordHttpErrorfn Client::paginate_guild_audit_log(self : Client, guild_id : Id[GuildMarker], user_id? : Id[UserMarker], action_type? : AuditLogEvent, before? : Id[AuditLogEntryMarker], page_size? : Int) -> Paginator[AuditLogEntry] raise DiscordHttpErrorfn Client::paginate_guild_bans(self : Client, guild_id : Id[GuildMarker], before? : Id[UserMarker], after? : Id[UserMarker], page_size? : Int) -> Paginator[GuildBan] raise DiscordHttpErrorfn Client::paginate_guild_members(self : Client, guild_id : Id[GuildMarker], after? : Id[UserMarker], page_size? : Int) -> Paginator[GuildMember] raise DiscordHttpErrortest "visit every guild member" {
async fn print_members(
client : @http.Client,
guild_id : @model.GuildId,
) -> Unit {
client
.paginate_guild_members(guild_id)
.each(guild_member => println("\{Repr(guild_member.user)}"))
}
ignore(print_members)
}fn Client::paginate_guild_scheduled_event_users(self : Client, guild_id : Id[GuildMarker], event_id : Id[ScheduledEventMarker], with_member? : Bool, before? : Id[UserMarker], after? : Id[UserMarker], page_size? : Int) -> Paginator[GuildScheduledEventUser] raise DiscordHttpErrorfn Client::paginate_messages(self : Client, channel_id : Id[ChannelMarker], before? : Id[MessageMarker], after? : Id[MessageMarker], around? : Id[MessageMarker], page_size? : Int) -> Paginator[Message] raise DiscordHttpErrortest "walk message history newest-first" {
async fn print_history(
client : @http.Client,
channel_id : @model.ChannelId,
newest_known : @model.MessageId,
) -> Unit {
let pages = client.paginate_messages(channel_id, page_size=100)
for ;; {
match pages.next_page() {
Some(messages) =>
for message in messages {
println("\{message.id}: \{message.content}")
}
None => break
}
}
// `collect` bounds the walk instead of draining the full history.
let recent = client
.paginate_messages(channel_id, before=newest_known, page_size=100)
.collect(max=250)
ignore(recent)
}
ignore(print_history)
}fn Client::paginate_poll_answer_voters(self : Client, channel_id : Id[ChannelMarker], message_id : Id[MessageMarker], answer_id : Int, after? : Id[UserMarker], page_size? : Int) -> Paginator[User] raise DiscordHttpErrorasync fn Client::pin_message(self : Client, channel_id : Id[ChannelMarker], message_id : Id[MessageMarker], audit_reason? : String) -> Unit raise DiscordHttpErrorasync fn Client::remove_guild_ban(self : Client, guild_id : Id[GuildMarker], user_id : Id[UserMarker], audit_reason? : String) -> Unit raise DiscordHttpErrorasync fn Client::remove_guild_member(self : Client, guild_id : Id[GuildMarker], user_id : Id[UserMarker], audit_reason? : String) -> Unit raise DiscordHttpErrorasync fn Client::remove_member_role(self : Client, guild_id : Id[GuildMarker], user_id : Id[UserMarker], role_id : Id[RoleMarker], audit_reason? : String) -> Unit raise DiscordHttpErrorasync fn Client::remove_thread_member(self : Client, channel_id : Id[ChannelMarker], user_id : Id[UserMarker]) -> Unit raise DiscordHttpErrorasync fn Client::request(self : Client, route : Route, body? : Json, audit_reason? : String, files? : Array[FileUpload], headers? : Map[String, String]) -> Json raise DiscordHttpErrorfn Client::scheduled_event_ref(self : Client, guild_id : Id[GuildMarker], event_id : Id[ScheduledEventMarker]) -> ScheduledEventRefasync fn Client::search_guild_members(self : Client, guild_id : Id[GuildMarker], query : String, limit? : Int) -> Array[GuildMember] raise DiscordHttpErrorasync fn Client::search_guild_messages(self : Client, guild_id : Id[GuildMarker], limit? : Int, offset? : Int, slop? : Int, content? : String, mention_everyone? : Bool, pinned? : Bool, include_nsfw? : Bool, sort_by? : String, sort_order? : String, max_id? : Id[MessageMarker], min_id? : Id[MessageMarker], channel_id? : Array[Id[ChannelMarker]], author_type? : Array[String], author_id? : Array[Id[UserMarker]], mentions? : Array[Id[UserMarker]], mentions_role_id? : Array[Id[RoleMarker]], replied_to_user_id? : Array[Id[UserMarker]], replied_to_message_id? : Array[Id[MessageMarker]], has? : Array[String], embed_type? : Array[String], embed_provider? : Array[String], link_hostname? : Array[String], attachment_filename? : Array[String], attachment_extension? : Array[String]) -> GuildMessageSearchResults raise DiscordHttpErrorasync fn Client::send_soundboard_sound(self : Client, channel_id : Id[ChannelMarker], sound_id : Id[SoundboardSoundMarker], source_guild_id? : Id[GuildMarker]) -> Unit raise DiscordHttpErrorasync fn Client::set_voice_channel_status(self : Client, channel_id : Id[ChannelMarker], status? : String, audit_reason? : String) -> Unit raise DiscordHttpErrorfn Client::soundboard_sound_ref(self : Client, guild_id : Id[GuildMarker], sound_id : Id[SoundboardSoundMarker]) -> SoundboardSoundRefasync fn Client::start_thread_from_message(self : Client, channel_id : Id[ChannelMarker], message_id : Id[MessageMarker], name : String, auto_archive_duration? : ThreadAutoArchiveDuration, rate_limit_per_user? : Int, audit_reason? : String) -> Channel raise DiscordHttpErrorasync fn Client::start_thread_in_forum_or_media_channel(self : Client, channel_id : Id[ChannelMarker], name : String, content? : String, embeds? : Array[Embed], components? : Array[Component], sticker_ids? : Array[Id[StickerMarker]], files? : Array[FileUpload], flags? : MessageFlags, allowed_mentions? : AllowedMentions, auto_archive_duration? : ThreadAutoArchiveDuration, rate_limit_per_user? : Int, applied_tags? : Array[Id[GenericMarker]], audit_reason? : String) -> Channel raise DiscordHttpErrorasync fn Client::start_thread_without_message(self : Client, channel_id : Id[ChannelMarker], name : String, typ? : ChannelType, auto_archive_duration? : ThreadAutoArchiveDuration, invitable? : Bool, rate_limit_per_user? : Int, audit_reason? : String) -> Channel raise DiscordHttpErrorfn Client::sticker_ref(self : Client, guild_id : Id[GuildMarker], sticker_id : Id[StickerMarker]) -> StickerRefasync fn Client::sync_guild_template(self : Client, guild_id : Id[GuildMarker], template_code : String) -> GuildTemplate raise DiscordHttpErrorasync fn Client::trigger_typing(self : Client, channel_id : Id[ChannelMarker]) -> Unit raise DiscordHttpErrorasync fn Client::unpin_message(self : Client, channel_id : Id[ChannelMarker], message_id : Id[MessageMarker], audit_reason? : String) -> Unit raise DiscordHttpErrorasync fn Client::update_application_role_connection_metadata_records(self : Client, application_id : Id[ApplicationMarker], records : Array[ApplicationRoleConnectionMetadata]) -> Array[ApplicationRoleConnectionMetadata] raise DiscordHttpErrorasync fn Client::update_current_user_application_role_connection(self : Client, application_id : Id[ApplicationMarker], platform_name? : String, platform_username? : String, metadata? : Json, bearer_token~ : String) -> ApplicationRoleConnection raise DiscordHttpErrorasync fn Client::update_invite_target_users(self : Client, code : String, target_users_file : FileUpload) -> Unit raise DiscordHttpErrorfn Client::webhook_token_ref(self : Client, webhook_id : Id[WebhookMarker], token : String) -> WebhookTokenRefpub struct EmojiRef {
// private fields
}async fn EmojiRef::edit(self : EmojiRef, name? : String, roles? : Array[Id[RoleMarker]], reason? : String) -> Emoji raise DiscordHttpErrorpub struct EntitlementRef {
// private fields
}pub struct FileUpload {
// private fields
}impl Debug for FileUploadfn FileUpload::FileUpload(filename : String, content : Bytes, content_type? : String, description? : String, title? : String, duration_secs? : Double, waveform? : String, is_spoiler? : Bool) -> FileUploadtest "describe attachments in payload_json" {
let files = [
@http.FileUpload(
"cat.png",
b"PNG",
content_type="image/png",
description="a cat",
is_spoiler=true,
),
]
json_inspect(@http.attachments_json(files), content=[
{
"id": 0,
"filename": "cat.png",
"description": "a cat",
"is_spoiler": true,
},
])
}pub struct GlobalCommandRef {
// private fields
}async fn GlobalCommandRef::edit(self : GlobalCommandRef, name? : String, description? : String, options? : Array[CommandOption], default_member_permissions? : Permissions, clear_default_member_permissions? : Bool, nsfw? : Bool, name_localizations? : Map[String, String], clear_name_localizations? : Bool, description_localizations? : Map[String, String], clear_description_localizations? : Bool, integration_types? : Array[ApplicationIntegrationType], contexts? : Array[InteractionContextType], handler? : EntryPointCommandHandlerType) -> ApplicationCommand raise DiscordHttpErrorasync fn GlobalCommandRef::fetch(self : GlobalCommandRef) -> ApplicationCommand raise DiscordHttpErrorpub struct GuildChannelPosition {
// private fields
}fn GuildChannelPosition::GuildChannelPosition(id : Id[ChannelMarker], position? : Int, lock_permissions? : Bool, parent_id? : Id[ChannelMarker], clear_parent_id? : Bool) -> GuildChannelPosition raise DiscordHttpErrorpub struct GuildCommandRef {
// private fields
}async fn GuildCommandRef::edit(self : GuildCommandRef, name? : String, description? : String, options? : Array[CommandOption], default_member_permissions? : Permissions, clear_default_member_permissions? : Bool, nsfw? : Bool, name_localizations? : Map[String, String], clear_name_localizations? : Bool, description_localizations? : Map[String, String], clear_description_localizations? : Bool) -> ApplicationCommand raise DiscordHttpErrorasync fn GuildCommandRef::edit_permissions(self : GuildCommandRef, permissions : Array[ApplicationCommandPermission], bearer_token~ : String) -> GuildApplicationCommandPermissions raise DiscordHttpErrorasync fn GuildCommandRef::fetch(self : GuildCommandRef) -> ApplicationCommand raise DiscordHttpErrorasync fn GuildCommandRef::permissions(self : GuildCommandRef) -> GuildApplicationCommandPermissions raise DiscordHttpErrorpub struct GuildRef {
// private fields
}async fn GuildRef::add_member(self : GuildRef, user_id : Id[UserMarker], access_token : String, nick? : String, roles? : Array[Id[RoleMarker]], mute? : Bool, deaf? : Bool) -> GuildMember? raise DiscordHttpErrorfn GuildRef::audit_log(self : GuildRef, user_id? : Id[UserMarker], action_type? : AuditLogEvent, before? : Id[AuditLogEntryMarker], page_size? : Int) -> Paginator[AuditLogEntry] raise DiscordHttpErrorfn GuildRef::auto_moderation_rule_ref(self : GuildRef, rule_id : Id[AutoModerationRuleMarker]) -> AutoModerationRuleRefasync fn GuildRef::auto_moderation_rules(self : GuildRef) -> Array[AutoModerationRule] raise DiscordHttpErrorfn GuildRef::bans(self : GuildRef, before? : Id[UserMarker], after? : Id[UserMarker], page_size? : Int) -> Paginator[GuildBan] raise DiscordHttpErrorasync fn GuildRef::begin_prune(self : GuildRef, days? : Int, compute_prune_count? : Bool, include_roles? : Array[Id[RoleMarker]], reason? : String) -> GuildPruneResult raise DiscordHttpErrorasync fn GuildRef::bulk_ban(self : GuildRef, user_ids : Array[Id[UserMarker]], delete_message_seconds? : Int, reason? : String) -> BulkBanResponse raise DiscordHttpErrorasync fn GuildRef::create_auto_moderation_rule(self : GuildRef, name : String, event_type : AutoModerationEventType, trigger_type : AutoModerationTriggerType, actions : Array[AutoModerationAction], trigger_metadata? : TriggerMetadata, enabled? : Bool, exempt_roles? : Array[Id[RoleMarker]], exempt_channels? : Array[Id[ChannelMarker]], reason? : String) -> AutoModerationRule raise DiscordHttpErrorasync fn GuildRef::create_channel(self : GuildRef, name : String, typ? : ChannelType, topic? : String, parent_id? : Id[ChannelMarker], position? : Int, permission_overwrites? : Array[Overwrite], nsfw? : Bool, bitrate? : Int, user_limit? : Int, rate_limit_per_user? : Int, rtc_region? : String, video_quality_mode? : VideoQualityMode, default_auto_archive_duration? : ThreadAutoArchiveDuration, available_tags? : Array[ForumTagRequest], default_reaction_emoji? : DefaultReaction, default_thread_rate_limit_per_user? : Int, default_sort_order? : SortOrderType, default_forum_layout? : ForumLayoutType, reason? : String) -> Channel raise DiscordHttpErrorasync fn GuildRef::create_emoji(self : GuildRef, name : String, image : String, roles? : Array[Id[RoleMarker]], reason? : String) -> Emoji raise DiscordHttpErrorasync fn GuildRef::create_role(self : GuildRef, name? : String, permissions? : Permissions, color? : Int, colors? : RoleColors, hoist? : Bool, icon? : String, unicode_emoji? : String, mentionable? : Bool, reason? : String) -> Role raise DiscordHttpErrorasync fn GuildRef::create_scheduled_event(self : GuildRef, name : String, privacy_level : GuildScheduledEventPrivacyLevel, scheduled_start_time : Timestamp, entity_type : GuildScheduledEventEntityType, channel_id? : Id[ChannelMarker], clear_channel_id? : Bool, entity_metadata? : EntityMetadata, clear_entity_metadata? : Bool, scheduled_end_time? : Timestamp, clear_scheduled_end_time? : Bool, description? : String, image? : String, recurrence_rule? : GuildScheduledEventRecurrenceRule, reason? : String) -> GuildScheduledEvent raise DiscordHttpErrorasync fn GuildRef::create_soundboard_sound(self : GuildRef, name : String, sound : String, volume? : Double, emoji_id? : Id[EmojiMarker], emoji_name? : String, reason? : String) -> SoundboardSound raise DiscordHttpErrorasync fn GuildRef::create_sticker(self : GuildRef, file : FileUpload, name : String, description : String, tags : String, reason? : String) -> Sticker raise DiscordHttpErrorasync fn GuildRef::create_template(self : GuildRef, name : String, description? : String) -> GuildTemplate raise DiscordHttpErrorasync fn GuildRef::delete_integration(self : GuildRef, integration_id : Id[IntegrationMarker], reason? : String) -> Unit raise DiscordHttpErrorasync fn GuildRef::edit(self : GuildRef, name? : String, verification_level? : VerificationLevel, default_message_notifications? : DefaultMessageNotifications, explicit_content_filter? : ExplicitContentFilter, afk_channel_id? : Id[ChannelMarker], clear_afk_channel_id? : Bool, afk_timeout? : Int, icon? : String, clear_icon? : Bool, owner_id? : Id[UserMarker], splash? : String, clear_splash? : Bool, discovery_splash? : String, clear_discovery_splash? : Bool, banner? : String, clear_banner? : Bool, system_channel_id? : Id[ChannelMarker], clear_system_channel_id? : Bool, system_channel_flags? : SystemChannelFlags, rules_channel_id? : Id[ChannelMarker], clear_rules_channel_id? : Bool, public_updates_channel_id? : Id[ChannelMarker], clear_public_updates_channel_id? : Bool, preferred_locale? : String, features? : Array[GuildFeature], description? : String, clear_description? : Bool, premium_progress_bar_enabled? : Bool, safety_alerts_channel_id? : Id[ChannelMarker], clear_safety_alerts_channel_id? : Bool, reason? : String) -> Guild raise DiscordHttpErrorasync fn GuildRef::edit_channel_positions(self : GuildRef, positions : Array[GuildChannelPosition], reason? : String) -> Unit raise DiscordHttpErrorasync fn GuildRef::edit_current_member(self : GuildRef, nick? : String, clear_nick? : Bool, avatar? : String, clear_avatar? : Bool, banner? : String, clear_banner? : Bool, bio? : String, clear_bio? : Bool, reason? : String) -> GuildMember raise DiscordHttpErrorasync fn GuildRef::edit_incident_actions(self : GuildRef, invites_disabled_until? : Timestamp, clear_invites_disabled_until? : Bool, dms_disabled_until? : Timestamp, clear_dms_disabled_until? : Bool) -> IncidentsData raise DiscordHttpErrorasync fn GuildRef::edit_my_voice_state(self : GuildRef, channel_id? : Id[ChannelMarker], suppress? : Bool, request_to_speak_timestamp? : Timestamp, clear_request_to_speak_timestamp? : Bool) -> Unit raise DiscordHttpErrorasync fn GuildRef::edit_onboarding(self : GuildRef, prompts : Array[OnboardingPrompt], default_channel_ids : Array[Id[ChannelMarker]], enabled : Bool, mode : OnboardingMode, reason? : String) -> GuildOnboarding raise DiscordHttpErrorasync fn GuildRef::edit_role_positions(self : GuildRef, positions : Array[(Id[RoleMarker], Int?)], reason? : String) -> Array[Role] raise DiscordHttpErrorasync fn GuildRef::edit_welcome_screen(self : GuildRef, enabled? : Bool, clear_enabled? : Bool, welcome_channels? : Array[WelcomeScreenChannel], clear_welcome_channels? : Bool, description? : String, clear_description? : Bool, reason? : String) -> WelcomeScreen raise DiscordHttpErrorasync fn GuildRef::edit_widget(self : GuildRef, enabled? : Bool, channel_id? : Id[ChannelMarker], clear_channel_id? : Bool, reason? : String) -> GuildWidgetSettings raise DiscordHttpErrorasync fn GuildRef::fetch_ban(self : GuildRef, user_id : Id[UserMarker]) -> GuildBan raise DiscordHttpErrorfn GuildRef::members(self : GuildRef, after? : Id[UserMarker], page_size? : Int) -> Paginator[GuildMember] raise DiscordHttpErrorasync fn GuildRef::prune_count(self : GuildRef, days? : Int, include_roles? : Array[Id[RoleMarker]]) -> GuildPruneResult raise DiscordHttpErrorfn GuildRef::scheduled_event_ref(self : GuildRef, event_id : Id[ScheduledEventMarker]) -> ScheduledEventRefasync fn GuildRef::scheduled_events(self : GuildRef, with_user_count? : Bool) -> Array[GuildScheduledEvent] raise DiscordHttpErrorasync fn GuildRef::search_members(self : GuildRef, query : String, limit? : Int) -> Array[GuildMember] raise DiscordHttpErrorasync fn GuildRef::search_messages(self : GuildRef, limit? : Int, offset? : Int, slop? : Int, content? : String, mention_everyone? : Bool, pinned? : Bool, include_nsfw? : Bool, sort_by? : String, sort_order? : String, max_id? : Id[MessageMarker], min_id? : Id[MessageMarker], channel_id? : Array[Id[ChannelMarker]], author_type? : Array[String], author_id? : Array[Id[UserMarker]], mentions? : Array[Id[UserMarker]], mentions_role_id? : Array[Id[RoleMarker]], replied_to_user_id? : Array[Id[UserMarker]], replied_to_message_id? : Array[Id[MessageMarker]], has? : Array[String], embed_type? : Array[String], embed_provider? : Array[String], link_hostname? : Array[String], attachment_filename? : Array[String], attachment_extension? : Array[String]) -> GuildMessageSearchResults raise DiscordHttpErrorfn GuildRef::soundboard_sound_ref(self : GuildRef, sound_id : Id[SoundboardSoundMarker]) -> SoundboardSoundRefasync fn GuildRef::soundboard_sounds(self : GuildRef) -> Array[SoundboardSound] raise DiscordHttpErrorpub(all) struct HttpRequest {
route : Route
body : Json?
audit_reason : String?
files : Array[FileUpload]?
headers : Map[String, String]
}pub struct InviteRef {
// private fields
}async fn InviteRef::fetch(self : InviteRef, with_counts? : Bool, guild_scheduled_event_id? : Id[ScheduledEventMarker]) -> Invite raise DiscordHttpErrorasync fn InviteRef::target_users_job_status(self : InviteRef) -> TargetUsersJobStatus raise DiscordHttpErrorasync fn InviteRef::update_target_users(self : InviteRef, target_users_file : FileUpload) -> Unit raise DiscordHttpErrorpub struct MemberRef {
// private fields
}async fn MemberRef::add_role(self : MemberRef, role_id : Id[RoleMarker], reason? : String) -> Unit raise DiscordHttpErrorasync fn MemberRef::ban(self : MemberRef, delete_message_seconds? : Int, reason? : String) -> Unit raise DiscordHttpErrorasync fn MemberRef::edit(self : MemberRef, nick? : String, clear_nick? : Bool, roles? : Array[Id[RoleMarker]], mute? : Bool, deaf? : Bool, channel_id? : Id[ChannelMarker], clear_channel_id? : Bool, communication_disabled_until? : Timestamp, clear_communication_disabled_until? : Bool, flags? : GuildMemberFlags, reason? : String) -> GuildMember raise DiscordHttpErrorasync fn MemberRef::edit_voice_state(self : MemberRef, channel_id : Id[ChannelMarker], suppress? : Bool) -> Unit raise DiscordHttpErrorasync fn MemberRef::remove_role(self : MemberRef, role_id : Id[RoleMarker], reason? : String) -> Unit raise DiscordHttpErrorasync fn MemberRef::timeout(self : MemberRef, until : Timestamp?, reason? : String) -> GuildMember raise DiscordHttpErrorpub struct MessageRef {
// private fields
}async fn MessageRef::delete_reactions_for(self : MessageRef, emoji : String) -> Unit raise DiscordHttpErrorasync fn MessageRef::delete_user_reaction(self : MessageRef, emoji : String, user_id : Id[UserMarker]) -> Unit raise DiscordHttpErrorasync fn MessageRef::edit(self : MessageRef, content? : String, clear_content? : Bool, embeds? : Array[Embed], components? : Array[Component], flags? : MessageFlags, allowed_mentions? : AllowedMentions, files? : Array[FileUpload], keep_attachments? : Array[AttachmentRequest]) -> Message raise DiscordHttpErrorasync fn MessageRef::forward(self : MessageRef, to : Id[ChannelMarker]) -> Message raise DiscordHttpErrorfn MessageRef::poll_answer_voters(self : MessageRef, answer_id : Int, after? : Id[UserMarker], page_size? : Int) -> Paginator[User] raise DiscordHttpErrorasync fn MessageRef::reactions(self : MessageRef, emoji : String, typ? : ReactionType, limit? : Int, after? : Id[UserMarker]) -> Array[User] raise DiscordHttpErrorasync fn MessageRef::reply(self : MessageRef, content? : String, embeds? : Array[Embed], components? : Array[Component], sticker_ids? : Array[Id[StickerMarker]], files? : Array[FileUpload], tts? : Bool, flags? : MessageFlags, allowed_mentions? : AllowedMentions, nonce? : Nonce, enforce_nonce? : Bool, poll? : PollCreateRequest) -> Message raise DiscordHttpErrorasync fn MessageRef::start_thread(self : MessageRef, name : String, auto_archive_duration? : ThreadAutoArchiveDuration, rate_limit_per_user? : Int, reason? : String) -> Channel raise DiscordHttpErrorpub enum MultipartChunk {
Text(String)
Blob(Bytes)
}pub struct Paginator[T] {
// private fields
}pub struct RoleRef {
// private fields
}async fn RoleRef::edit(self : RoleRef, name? : String, permissions? : Permissions, color? : Int, colors? : RoleColors, hoist? : Bool, icon? : String, clear_icon? : Bool, unicode_emoji? : String, clear_unicode_emoji? : Bool, mentionable? : Bool, reason? : String) -> Role raise DiscordHttpErrorpub(all) enum Route {
Custom(request_method~ : RequestMethod, path~ : String, bucket_key~ : String, is_interaction~ : Bool, supports_reason~ : Bool)
GetGateway
GetGatewayBot
GetCurrentApplication
EditCurrentApplication
GetApplicationActivityInstance(application_id~ : Id[ApplicationMarker], instance_id~ : String)
GetApplicationRoleConnectionMetadataRecords(application_id~ : Id[ApplicationMarker])
UpdateApplicationRoleConnectionMetadataRecords(application_id~ : Id[ApplicationMarker])
ListApplicationEmojis(application_id~ : Id[ApplicationMarker])
GetApplicationEmoji(application_id~ : Id[ApplicationMarker], emoji_id~ : Id[EmojiMarker])
CreateApplicationEmoji(application_id~ : Id[ApplicationMarker])
ModifyApplicationEmoji(application_id~ : Id[ApplicationMarker], emoji_id~ : Id[EmojiMarker])
DeleteApplicationEmoji(application_id~ : Id[ApplicationMarker], emoji_id~ : Id[EmojiMarker])
ListEntitlements(application_id~ : Id[ApplicationMarker], query~ : String)
GetEntitlement(application_id~ : Id[ApplicationMarker], entitlement_id~ : Id[EntitlementMarker])
CreateTestEntitlement(application_id~ : Id[ApplicationMarker])
ConsumeEntitlement(application_id~ : Id[ApplicationMarker], entitlement_id~ : Id[EntitlementMarker])
DeleteTestEntitlement(application_id~ : Id[ApplicationMarker], entitlement_id~ : Id[EntitlementMarker])
ListSkus(application_id~ : Id[ApplicationMarker])
ListSkuSubscriptions(sku_id~ : Id[SkuMarker], query~ : String)
GetSkuSubscription(sku_id~ : Id[SkuMarker], subscription_id~ : Id[SubscriptionMarker])
GetCurrentUser
GetCurrentUserGuilds(query~ : String)
GetCurrentUserConnections
GetCurrentUserGuildMember(guild_id~ : Id[GuildMarker])
GetCurrentUserApplicationRoleConnection(application_id~ : Id[ApplicationMarker])
UpdateCurrentUserApplicationRoleConnection(application_id~ : Id[ApplicationMarker])
DeleteCurrentUserApplicationRoleConnection(application_id~ : Id[ApplicationMarker])
LeaveGuild(guild_id~ : Id[GuildMarker])
GetUser(user_id~ : Id[UserMarker])
ModifyCurrentUser
CreateDm
GetCurrentAuthorizationInformation
GetCurrentBotApplicationInformation
GetChannel(channel_id~ : Id[ChannelMarker])
ModifyChannel(channel_id~ : Id[ChannelMarker])
DeleteChannel(channel_id~ : Id[ChannelMarker])
GetChannelMessages(channel_id~ : Id[ChannelMarker], query~ : String)
GetChannelMessage(channel_id~ : Id[ChannelMarker], message_id~ : Id[MessageMarker])
CreateMessage(channel_id~ : Id[ChannelMarker])
EditMessage(channel_id~ : Id[ChannelMarker], message_id~ : Id[MessageMarker])
DeleteMessage(channel_id~ : Id[ChannelMarker], message_id~ : Id[MessageMarker])
BulkDeleteMessages(channel_id~ : Id[ChannelMarker])
CreateReaction(channel_id~ : Id[ChannelMarker], message_id~ : Id[MessageMarker], emoji~ : String)
DeleteOwnReaction(channel_id~ : Id[ChannelMarker], message_id~ : Id[MessageMarker], emoji~ : String)
DeleteUserReaction(channel_id~ : Id[ChannelMarker], message_id~ : Id[MessageMarker], emoji~ : String, user_id~ : Id[UserMarker])
DeleteAllReactions(channel_id~ : Id[ChannelMarker], message_id~ : Id[MessageMarker])
DeleteAllReactionsForEmoji(channel_id~ : Id[ChannelMarker], message_id~ : Id[MessageMarker], emoji~ : String)
CrosspostMessage(channel_id~ : Id[ChannelMarker], message_id~ : Id[MessageMarker])
GetReactions(channel_id~ : Id[ChannelMarker], message_id~ : Id[MessageMarker], emoji~ : String, query~ : String)
GetPollAnswerVoters(channel_id~ : Id[ChannelMarker], message_id~ : Id[MessageMarker], answer_id~ : Int, query~ : String)
ExpirePoll(channel_id~ : Id[ChannelMarker], message_id~ : Id[MessageMarker])
SendSoundboardSound(channel_id~ : Id[ChannelMarker])
TriggerTypingIndicator(channel_id~ : Id[ChannelMarker])
PinMessage(channel_id~ : Id[ChannelMarker], message_id~ : Id[MessageMarker])
UnpinMessage(channel_id~ : Id[ChannelMarker], message_id~ : Id[MessageMarker])
GetChannelPins(channel_id~ : Id[ChannelMarker], query~ : String)
GetPinnedMessages(channel_id~ : Id[ChannelMarker])
EditChannelPermissions(channel_id~ : Id[ChannelMarker], overwrite_id~ : Id[GenericMarker])
DeleteChannelPermission(channel_id~ : Id[ChannelMarker], overwrite_id~ : Id[GenericMarker])
GetChannelInvites(channel_id~ : Id[ChannelMarker])
CreateChannelInvite(channel_id~ : Id[ChannelMarker])
FollowAnnouncementChannel(channel_id~ : Id[ChannelMarker])
SetVoiceChannelStatus(channel_id~ : Id[ChannelMarker])
GroupDmAddRecipient(channel_id~ : Id[ChannelMarker], user_id~ : Id[UserMarker])
GroupDmRemoveRecipient(channel_id~ : Id[ChannelMarker], user_id~ : Id[UserMarker])
CreateWebhook(channel_id~ : Id[ChannelMarker])
GetChannelWebhooks(channel_id~ : Id[ChannelMarker])
StartThreadFromMessage(channel_id~ : Id[ChannelMarker], message_id~ : Id[MessageMarker])
StartThreadWithoutMessage(channel_id~ : Id[ChannelMarker])
JoinThread(channel_id~ : Id[ChannelMarker])
LeaveThread(channel_id~ : Id[ChannelMarker])
ListThreadMembers(channel_id~ : Id[ChannelMarker], query~ : String)
GetThreadMember(channel_id~ : Id[ChannelMarker], user_id~ : Id[UserMarker], query~ : String)
AddThreadMember(channel_id~ : Id[ChannelMarker], user_id~ : Id[UserMarker])
RemoveThreadMember(channel_id~ : Id[ChannelMarker], user_id~ : Id[UserMarker])
ListPublicArchivedThreads(channel_id~ : Id[ChannelMarker], query~ : String)
ListPrivateArchivedThreads(channel_id~ : Id[ChannelMarker], query~ : String)
ListJoinedPrivateArchivedThreads(channel_id~ : Id[ChannelMarker], query~ : String)
ListActiveGuildThreads(guild_id~ : Id[GuildMarker])
SearchGuildMessages(guild_id~ : Id[GuildMarker], query~ : String)
GetGuild(guild_id~ : Id[GuildMarker])
GetGuildWithCounts(guild_id~ : Id[GuildMarker], query~ : String)
ModifyGuild(guild_id~ : Id[GuildMarker])
GetGuildPreview(guild_id~ : Id[GuildMarker])
GetGuildChannels(guild_id~ : Id[GuildMarker])
CreateGuildChannel(guild_id~ : Id[GuildMarker])
ModifyGuildChannelPositions(guild_id~ : Id[GuildMarker])
GetGuildMember(guild_id~ : Id[GuildMarker], user_id~ : Id[UserMarker])
ListGuildMembers(guild_id~ : Id[GuildMarker], query~ : String)
SearchGuildMembers(guild_id~ : Id[GuildMarker], query~ : String)
ModifyGuildMember(guild_id~ : Id[GuildMarker], user_id~ : Id[UserMarker])
ModifyCurrentMember(guild_id~ : Id[GuildMarker])
AddGuildMember(guild_id~ : Id[GuildMarker], user_id~ : Id[UserMarker])
GetGuildRoles(guild_id~ : Id[GuildMarker])
GetGuildRole(guild_id~ : Id[GuildMarker], role_id~ : Id[RoleMarker])
CreateGuildRole(guild_id~ : Id[GuildMarker])
ModifyGuildRolePositions(guild_id~ : Id[GuildMarker])
ModifyGuildRole(guild_id~ : Id[GuildMarker], role_id~ : Id[RoleMarker])
DeleteGuildRole(guild_id~ : Id[GuildMarker], role_id~ : Id[RoleMarker])
AddGuildMemberRole(guild_id~ : Id[GuildMarker], user_id~ : Id[UserMarker], role_id~ : Id[RoleMarker])
RemoveGuildMemberRole(guild_id~ : Id[GuildMarker], user_id~ : Id[UserMarker], role_id~ : Id[RoleMarker])
RemoveGuildMember(guild_id~ : Id[GuildMarker], user_id~ : Id[UserMarker])
CreateGuildBan(guild_id~ : Id[GuildMarker], user_id~ : Id[UserMarker])
RemoveGuildBan(guild_id~ : Id[GuildMarker], user_id~ : Id[UserMarker])
GetGuildBan(guild_id~ : Id[GuildMarker], user_id~ : Id[UserMarker])
GetGuildBans(guild_id~ : Id[GuildMarker], query~ : String)
BulkGuildBan(guild_id~ : Id[GuildMarker])
GetGuildPruneCount(guild_id~ : Id[GuildMarker], query~ : String)
BeginGuildPrune(guild_id~ : Id[GuildMarker])
GetGuildVoiceRegions(guild_id~ : Id[GuildMarker])
GetGuildInvites(guild_id~ : Id[GuildMarker])
GetGuildIntegrations(guild_id~ : Id[GuildMarker])
DeleteGuildIntegration(guild_id~ : Id[GuildMarker], integration_id~ : Id[IntegrationMarker])
GetGuildVanityUrl(guild_id~ : Id[GuildMarker])
GetGuildWidgetSettings(guild_id~ : Id[GuildMarker])
ModifyGuildWidget(guild_id~ : Id[GuildMarker])
GetGuildWidget(guild_id~ : Id[GuildMarker])
GetGuildWelcomeScreen(guild_id~ : Id[GuildMarker])
ModifyGuildWelcomeScreen(guild_id~ : Id[GuildMarker])
GetGuildOnboarding(guild_id~ : Id[GuildMarker])
ModifyGuildOnboarding(guild_id~ : Id[GuildMarker])
ModifyGuildIncidentActions(guild_id~ : Id[GuildMarker])
GetGuildAuditLog(guild_id~ : Id[GuildMarker], query~ : String)
ListAutoModerationRules(guild_id~ : Id[GuildMarker])
GetAutoModerationRule(guild_id~ : Id[GuildMarker], rule_id~ : Id[AutoModerationRuleMarker])
CreateAutoModerationRule(guild_id~ : Id[GuildMarker])
ModifyAutoModerationRule(guild_id~ : Id[GuildMarker], rule_id~ : Id[AutoModerationRuleMarker])
DeleteAutoModerationRule(guild_id~ : Id[GuildMarker], rule_id~ : Id[AutoModerationRuleMarker])
ListGuildStickers(guild_id~ : Id[GuildMarker])
GetGuildSticker(guild_id~ : Id[GuildMarker], sticker_id~ : Id[StickerMarker])
CreateGuildSticker(guild_id~ : Id[GuildMarker])
ModifyGuildSticker(guild_id~ : Id[GuildMarker], sticker_id~ : Id[StickerMarker])
DeleteGuildSticker(guild_id~ : Id[GuildMarker], sticker_id~ : Id[StickerMarker])
ListGuildScheduledEvents(guild_id~ : Id[GuildMarker], query~ : String)
CreateGuildScheduledEvent(guild_id~ : Id[GuildMarker])
GetGuildScheduledEvent(guild_id~ : Id[GuildMarker], event_id~ : Id[ScheduledEventMarker], query~ : String)
ModifyGuildScheduledEvent(guild_id~ : Id[GuildMarker], event_id~ : Id[ScheduledEventMarker])
DeleteGuildScheduledEvent(guild_id~ : Id[GuildMarker], event_id~ : Id[ScheduledEventMarker])
ListGuildScheduledEventUsers(guild_id~ : Id[GuildMarker], event_id~ : Id[ScheduledEventMarker], query~ : String)
ListGuildSoundboardSounds(guild_id~ : Id[GuildMarker])
CreateGuildSoundboardSound(guild_id~ : Id[GuildMarker])
GetGuildSoundboardSound(guild_id~ : Id[GuildMarker], sound_id~ : Id[SoundboardSoundMarker])
ModifyGuildSoundboardSound(guild_id~ : Id[GuildMarker], sound_id~ : Id[SoundboardSoundMarker])
DeleteGuildSoundboardSound(guild_id~ : Id[GuildMarker], sound_id~ : Id[SoundboardSoundMarker])
GetGuildWebhooks(guild_id~ : Id[GuildMarker])
ListGuildEmojis(guild_id~ : Id[GuildMarker])
GetGuildEmoji(guild_id~ : Id[GuildMarker], emoji_id~ : Id[EmojiMarker])
CreateGuildEmoji(guild_id~ : Id[GuildMarker])
ModifyGuildEmoji(guild_id~ : Id[GuildMarker], emoji_id~ : Id[EmojiMarker])
DeleteGuildEmoji(guild_id~ : Id[GuildMarker], emoji_id~ : Id[EmojiMarker])
GetSticker(sticker_id~ : Id[StickerMarker])
ListStickerPacks
GetStickerPack(pack_id~ : Id[StickerPackMarker])
ListDefaultSoundboardSounds
ListVoiceRegions
GetCurrentUserVoiceState(guild_id~ : Id[GuildMarker])
GetUserVoiceState(guild_id~ : Id[GuildMarker], user_id~ : Id[UserMarker])
ModifyCurrentUserVoiceState(guild_id~ : Id[GuildMarker])
ModifyUserVoiceState(guild_id~ : Id[GuildMarker], user_id~ : Id[UserMarker])
GetGuildTemplate(template_code~ : String)
CreateGuildFromTemplate(template_code~ : String)
GetGuildTemplates(guild_id~ : Id[GuildMarker])
CreateGuildTemplate(guild_id~ : Id[GuildMarker])
SyncGuildTemplate(guild_id~ : Id[GuildMarker], template_code~ : String)
ModifyGuildTemplate(guild_id~ : Id[GuildMarker], template_code~ : String)
DeleteGuildTemplate(guild_id~ : Id[GuildMarker], template_code~ : String)
CreateStageInstance
GetStageInstance(channel_id~ : Id[ChannelMarker])
ModifyStageInstance(channel_id~ : Id[ChannelMarker])
DeleteStageInstance(channel_id~ : Id[ChannelMarker])
GetInvite(code~ : String, query~ : String)
DeleteInvite(code~ : String)
UpdateInviteTargetUsers(code~ : String)
GetInviteTargetUsersJobStatus(code~ : String)
GetWebhook(webhook_id~ : Id[WebhookMarker])
ModifyWebhook(webhook_id~ : Id[WebhookMarker])
DeleteWebhook(webhook_id~ : Id[WebhookMarker])
GetWebhookWithToken(webhook_id~ : Id[WebhookMarker], token~ : String)
ModifyWebhookWithToken(webhook_id~ : Id[WebhookMarker], token~ : String)
DeleteWebhookWithToken(webhook_id~ : Id[WebhookMarker], token~ : String)
ExecuteWebhook(webhook_id~ : Id[WebhookMarker], token~ : String, query~ : String)
ExecuteSlackCompatibleWebhook(webhook_id~ : Id[WebhookMarker], token~ : String, query~ : String)
ExecuteGithubCompatibleWebhook(webhook_id~ : Id[WebhookMarker], token~ : String, query~ : String)
GetWebhookMessage(webhook_id~ : Id[WebhookMarker], token~ : String, message_id~ : Id[MessageMarker], query~ : String)
EditWebhookMessage(webhook_id~ : Id[WebhookMarker], token~ : String, message_id~ : Id[MessageMarker], query~ : String)
DeleteWebhookMessage(webhook_id~ : Id[WebhookMarker], token~ : String, message_id~ : Id[MessageMarker], query~ : String)
CreateInteractionResponse(interaction_id~ : Id[InteractionMarker], token~ : String, query~ : String)
GetOriginalInteractionResponse(application_id~ : Id[ApplicationMarker], token~ : String)
EditOriginalInteractionResponse(application_id~ : Id[ApplicationMarker], token~ : String)
DeleteOriginalInteractionResponse(application_id~ : Id[ApplicationMarker], token~ : String)
CreateFollowupMessage(application_id~ : Id[ApplicationMarker], token~ : String)
GetFollowupMessage(application_id~ : Id[ApplicationMarker], token~ : String, message_id~ : Id[MessageMarker])
EditFollowupMessage(application_id~ : Id[ApplicationMarker], token~ : String, message_id~ : Id[MessageMarker])
DeleteFollowupMessage(application_id~ : Id[ApplicationMarker], token~ : String, message_id~ : Id[MessageMarker])
GetGlobalCommands(application_id~ : Id[ApplicationMarker], query~ : String)
CreateGlobalCommand(application_id~ : Id[ApplicationMarker])
GetGlobalCommand(application_id~ : Id[ApplicationMarker], command_id~ : Id[CommandMarker])
EditGlobalCommand(application_id~ : Id[ApplicationMarker], command_id~ : Id[CommandMarker])
DeleteGlobalCommand(application_id~ : Id[ApplicationMarker], command_id~ : Id[CommandMarker])
BulkOverwriteGlobalCommands(application_id~ : Id[ApplicationMarker])
GetGuildCommands(application_id~ : Id[ApplicationMarker], guild_id~ : Id[GuildMarker], query~ : String)
CreateGuildCommand(application_id~ : Id[ApplicationMarker], guild_id~ : Id[GuildMarker])
GetGuildCommand(application_id~ : Id[ApplicationMarker], guild_id~ : Id[GuildMarker], command_id~ : Id[CommandMarker])
EditGuildCommand(application_id~ : Id[ApplicationMarker], guild_id~ : Id[GuildMarker], command_id~ : Id[CommandMarker])
DeleteGuildCommand(application_id~ : Id[ApplicationMarker], guild_id~ : Id[GuildMarker], command_id~ : Id[CommandMarker])
BulkOverwriteGuildCommands(application_id~ : Id[ApplicationMarker], guild_id~ : Id[GuildMarker])
GetGuildApplicationCommandPermissions(application_id~ : Id[ApplicationMarker], guild_id~ : Id[GuildMarker])
GetApplicationCommandPermissions(application_id~ : Id[ApplicationMarker], guild_id~ : Id[GuildMarker], command_id~ : Id[CommandMarker])
EditApplicationCommandPermissions(application_id~ : Id[ApplicationMarker], guild_id~ : Id[GuildMarker], command_id~ : Id[CommandMarker])
}fn Route::custom(request_method~ : RequestMethod, path~ : String, bucket? : String, is_interaction? : Bool, supports_reason? : Bool) -> Route raise CustomRouteErrortest "derive stable metadata for a custom route" {
let route = @http.Route::custom(
request_method=Get,
path="/guilds/100/stickers?limit=25",
)
inspect(route.path(), content="/guilds/100/stickers?limit=25")
inspect(route.bucket(), content="CUSTOM:GET:/guilds/100/stickers")
assert_true(route.needs_auth())
}pub struct ScheduledEventRef {
// private fields
}async fn ScheduledEventRef::delete(self : ScheduledEventRef, reason? : String) -> Unit raise DiscordHttpErrorasync fn ScheduledEventRef::edit(self : ScheduledEventRef, channel_id? : Id[ChannelMarker], clear_channel_id? : Bool, entity_metadata? : EntityMetadata, clear_entity_metadata? : Bool, name? : String, privacy_level? : GuildScheduledEventPrivacyLevel, scheduled_start_time? : Timestamp, scheduled_end_time? : Timestamp, clear_scheduled_end_time? : Bool, description? : String, clear_description? : Bool, entity_type? : GuildScheduledEventEntityType, status? : GuildScheduledEventStatus, image? : String, clear_image? : Bool, recurrence_rule? : GuildScheduledEventRecurrenceRule, clear_recurrence_rule? : Bool, reason? : String) -> GuildScheduledEvent raise DiscordHttpErrorasync fn ScheduledEventRef::fetch(self : ScheduledEventRef, with_user_count? : Bool) -> GuildScheduledEvent raise DiscordHttpErrorfn ScheduledEventRef::users(self : ScheduledEventRef, with_member? : Bool, before? : Id[UserMarker], after? : Id[UserMarker], page_size? : Int) -> Paginator[GuildScheduledEventUser] raise DiscordHttpErrorpub struct SkuRef {
// private fields
}async fn SkuRef::subscription(self : SkuRef, subscription_id : Id[SubscriptionMarker]) -> Subscription raise DiscordHttpErrorasync fn SkuRef::subscriptions(self : SkuRef, before? : Id[SubscriptionMarker], after? : Id[SubscriptionMarker], limit? : Int, user_id? : Id[UserMarker]) -> Array[Subscription] raise DiscordHttpErrorpub struct SoundboardSoundRef {
// private fields
}async fn SoundboardSoundRef::delete(self : SoundboardSoundRef, reason? : String) -> Unit raise DiscordHttpErrorasync fn SoundboardSoundRef::edit(self : SoundboardSoundRef, name? : String, volume? : Double, emoji_id? : Id[EmojiMarker], clear_emoji_id? : Bool, emoji_name? : String, clear_emoji_name? : Bool, reason? : String) -> SoundboardSound raise DiscordHttpErrorasync fn SoundboardSoundRef::fetch(self : SoundboardSoundRef) -> SoundboardSound raise DiscordHttpErrorpub struct StickerRef {
// private fields
}async fn StickerRef::edit(self : StickerRef, name? : String, description? : String, clear_description? : Bool, tags? : String, reason? : String) -> Sticker raise DiscordHttpErrorpub struct TemplateRef {
// private fields
}async fn TemplateRef::create_guild(self : TemplateRef, name : String, icon? : String) -> Guild raise DiscordHttpErrorasync fn TemplateRef::edit(self : TemplateRef, name? : String, description? : String, clear_description? : Bool) -> GuildTemplate raise DiscordHttpErrorpub struct UserRef {
// private fields
}pub struct WebhookMessageRef {
// private fields
}async fn WebhookMessageRef::delete(self : WebhookMessageRef, thread_id? : Id[ChannelMarker]) -> Unit raise DiscordHttpErrorasync fn WebhookMessageRef::edit(self : WebhookMessageRef, content? : String, clear_content? : Bool, embeds? : Array[Embed], components? : Array[Component], flags? : MessageFlags, allowed_mentions? : AllowedMentions, files? : Array[FileUpload], keep_attachments? : Array[AttachmentRequest], thread_id? : Id[ChannelMarker], with_components? : Bool) -> Message raise DiscordHttpErrorasync fn WebhookMessageRef::fetch(self : WebhookMessageRef, thread_id? : Id[ChannelMarker]) -> Message raise DiscordHttpErrorpub struct WebhookRef {
// private fields
}async fn WebhookRef::edit(self : WebhookRef, name? : String, avatar? : String, clear_avatar? : Bool, channel_id? : Id[ChannelMarker], reason? : String) -> Webhook raise DiscordHttpErrorpub struct WebhookTokenRef {
// private fields
}async fn WebhookTokenRef::edit(self : WebhookTokenRef, name? : String, avatar? : String, clear_avatar? : Bool) -> Webhook raise DiscordHttpErrorfn WebhookTokenRef::message_ref(self : WebhookTokenRef, message_id : Id[MessageMarker]) -> WebhookMessageRefasync fn WebhookTokenRef::send(self : WebhookTokenRef, content? : String, embeds? : Array[Embed], components? : Array[Component], files? : Array[FileUpload], username? : String, avatar_url? : String, tts? : Bool, allowed_mentions? : AllowedMentions, thread_id? : Id[ChannelMarker], thread_name? : String, applied_tags? : Array[Id[GenericMarker]], poll? : PollCreateRequest, with_components? : Bool, flags? : MessageFlags) -> Message raise DiscordHttpErrorasync fn WebhookTokenRef::send_github(self : WebhookTokenRef, payload : Json, github_event~ : String, thread_id? : Id[ChannelMarker], wait? : Bool) -> Unit raise DiscordHttpErrorasync fn WebhookTokenRef::send_slack(self : WebhookTokenRef, payload : Json, thread_id? : Id[ChannelMarker], wait? : Bool) -> Unit raise DiscordHttpErrorfn encode_multipart_body(payload_json : String, files : Array[FileUpload]) -> (String, Array[MultipartChunk]) raise DiscordHttpErrortest "keep uploaded bytes as a multipart blob chunk" {
let (content_type, chunks) = @http.encode_multipart_body("{\"type\":4}", [
FileUpload("hello.txt", b"hello", content_type="text/plain"),
])
assert_true(content_type.has_prefix("multipart/form-data; boundary="))
match chunks {
[Text(payload), Text(file_header), Blob(content), ..] => {
assert_true(payload.contains("payload_json"))
assert_true(file_header.contains("files[0]"))
assert_eq(content, b"hello")
}
_ => fail("unexpected multipart chunk layout")
}
}Install
Download zipAn experimental Discord library for MoonBit: typed APIs, a native gateway with voice (DAVE E2EE), and JS/serverless HTTP interactions.
Dependencies