{ "openapi": "3.0.1", "info": { "title": "Microfox Discord SDK API", "version": "1.0.0", "mcp_version": "1.0.1", "description": "Single entry-point API for all Microfox Discord SDK functions via a wrapper Lambda", "contact": { "name": "Microfox Dev Support", "email": "support@microfox.com" } }, "servers": [ { "url": "https://api.microfox.com/c/discord", "description": "Unified wrapper endpoint" } ], "paths": { "/sendMessage": { "post": { "operationId": "sendMessage", "summary": "Sends a message to a specified channel or user in Discord.", "description": "This function allows sending messages to either a specific channel or directly to a user in Discord. It supports sending text content, embedding images/links, and including rich embeds. The function is versatile, enabling various types of message compositions for different communication needs.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "description": "Body of the sendMessage sls call", "properties": { "arguments": { "type": "array", "items": [ { "type": "object", "description": "Message data object containing all parameters for sending a message", "properties": { "content": { "type": "string", "description": "The text content of the message." }, "userId": { "type": "string", "description": "The ID of the user to send a direct message to. If provided, channelId is ignored and a new DM channel is created." }, "channelId": { "type": "string", "description": "The ID of the channel to send the message to. Required if userId is not provided." }, "fileUrl": { "type": "string", "description": "A URL to an image or file to embed in the message. If provided, it will be displayed as an embed." }, "embed": { "type": "object", "description": "A rich embed object to include in the message.", "properties": { "title": { "type": "string", "description": "The title of the embed." }, "description": { "type": "string", "description": "The description of the embed." }, "color": { "type": "number", "description": "The color of the embed (decimal)." }, "image": { "type": "string", "description": "A URL to an image to display in the embed." } } } }, "required": [] } ] }, "auth": { "type": "object", "description": "Authentication object", "properties": { "strategy": { "type": "string", "description": "Authentication strategy", "enum": [ "apikey" ] }, "variables": { "type": "array", "description": "Variables for the authentication strategy", "items": [ { "type": "object", "properties": { "key": { "type": "string", "description": "DISCORD_BOT_TOKEN" }, "value": { "type": "string", "description": "value of DISCORD_BOT_TOKEN" } } } ] } } }, "packageName": { "type": "string", "description": "@microfox/discord" } }, "required": [ "arguments" ] } } } } } }, "responses": { "200": { "description": "Message sent successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "description": "The ID of the sent message" }, "content": { "type": "string", "description": "The content of the sent message" }, "channelId": { "type": "string", "description": "The ID of the channel where the message was sent" }, "timestamp": { "type": "string", "format": "date-time", "description": "The timestamp when the message was sent" } } } } } }, "400": { "description": "Bad request - invalid parameters", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the issue with the request" } } } } } }, "403": { "description": "Forbidden - lack of permissions to send the message", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating lack of permissions" } } } } } }, "404": { "description": "Not found - channel or user not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating the channel or user was not found" } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the internal server error" } } } } } } } } }, "/editMessage": { "post": { "operationId": "editMessage", "summary": "Edits an existing message in a Discord channel, allowing modification of text content and embedded media.", "description": "This function updates the content of a previously sent message in a specified Discord channel. It allows for modification of both text content and embedded media. The function can replace the existing text with new content and optionally update or add an embedded image or file.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "description": "Body of the editMessage sls call", "properties": { "arguments": { "type": "array", "items": [ { "type": "string", "description": "The ID of the channel containing the message." }, { "type": "string", "description": "The ID of the message to edit." }, { "type": "string", "description": "The new text content for the message." }, { "type": "string", "description": "A new URL to an image or file to embed in the message. If provided, it will replace the existing embed.", "optional": true } ] }, "auth": { "type": "object", "description": "Authentication object", "properties": { "strategy": { "type": "string", "description": "Authentication strategy", "enum": [ "apikey" ] }, "variables": { "type": "array", "description": "Variables for the authentication strategy", "items": [ { "type": "object", "properties": { "key": { "type": "string", "description": "DISCORD_BOT_TOKEN" }, "value": { "type": "string", "description": "value of DISCORD_BOT_TOKEN" } } } ] } } }, "packageName": { "type": "string", "description": "@microfox/discord" } }, "required": [ "arguments" ] } } } } } }, "responses": { "200": { "description": "Successfully edited the message", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "description": "The ID of the edited message" }, "content": { "type": "string", "description": "The updated text content of the message" }, "channel_id": { "type": "string", "description": "The ID of the channel containing the message" }, "embeds": { "type": "array", "items": { "type": "object", "description": "Embedded media in the message" }, "description": "Array of embeds in the message" } } } } } }, "400": { "description": "Bad request - invalid parameters", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the issue with the request" } } } } } }, "403": { "description": "Forbidden - insufficient permissions to edit the message", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating lack of permissions" } } } } } }, "404": { "description": "Message or channel not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating the resource was not found" } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the internal server error" } } } } } } } } }, "/deleteMessage": { "post": { "operationId": "deleteMessage", "summary": "Delete a specific message from a Discord channel.", "description": "This function removes a specified message from a given Discord channel. It takes the channel ID and message ID as parameters and returns a Promise that resolves when the deletion is complete. This allows for programmatic management of channel content.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "description": "Body of the deleteMessage sls call", "properties": { "arguments": { "type": "array", "items": [ { "type": "string", "description": "The ID of the channel containing the message to be deleted." }, { "type": "string", "description": "The ID of the message to be deleted." } ] }, "auth": { "type": "object", "description": "Authentication object", "properties": { "strategy": { "type": "string", "description": "Authentication strategy", "enum": [ "apikey" ] }, "variables": { "type": "array", "description": "Variables for the authentication strategy", "items": [ { "type": "object", "properties": { "key": { "type": "string", "description": "DISCORD_BOT_TOKEN" }, "value": { "type": "string", "description": "value of DISCORD_BOT_TOKEN" } } } ] } } }, "packageName": { "type": "string", "description": "@microfox/discord" } }, "required": [ "arguments" ] } } } } } }, "responses": { "200": { "description": "Message successfully deleted", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "description": "Indicates whether the deletion was successful" } } } } } }, "400": { "description": "Bad request - invalid channel ID or message ID", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the issue" } } } } } }, "403": { "description": "Forbidden - insufficient permissions to delete the message", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the permission issue" } } } } } }, "404": { "description": "Not found - channel or message does not exist", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating the resource was not found" } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the server error" } } } } } } } } }, "/fetchMessages": { "post": { "operationId": "fetchMessages", "summary": "Fetches recent messages from a specified Discord channel.", "description": "This function retrieves a specified number of messages from a channel's history in Discord. It allows fetching up to a certain limit of messages, defaulting to 10 if not specified. The function returns a Promise that resolves to an array of message objects.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "description": "Body of the fetchMessages sls call", "properties": { "arguments": { "type": "array", "items": [ { "type": "string", "description": "The ID of the channel to fetch messages from." }, { "type": "number", "description": "The maximum number of messages to fetch (default is 10).", "default": 10 } ] }, "auth": { "type": "object", "description": "Authentication object", "properties": { "strategy": { "type": "string", "description": "Authentication strategy", "enum": [ "apikey" ] }, "variables": { "type": "array", "description": "Variables for the authentication strategy", "items": [ { "type": "object", "properties": { "key": { "type": "string", "description": "DISCORD_BOT_TOKEN" }, "value": { "type": "string", "description": "value of DISCORD_BOT_TOKEN" } } } ] } } }, "packageName": { "type": "string", "description": "@microfox/discord" } }, "required": [ "arguments" ] } } } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "description": "Message object", "properties": { "id": { "type": "string", "description": "Unique identifier of the message" }, "content": { "type": "string", "description": "Content of the message" }, "author": { "type": "object", "description": "Author of the message", "properties": { "id": { "type": "string", "description": "User ID of the author" }, "username": { "type": "string", "description": "Username of the author" } } }, "timestamp": { "type": "string", "format": "date-time", "description": "Timestamp of when the message was sent" } } } } } } }, "400": { "description": "Bad Request - Invalid parameters", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the issue" } } } } } }, "403": { "description": "Forbidden - Not authorized to access the channel", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating lack of permissions" } } } } } }, "404": { "description": "Not Found - Channel does not exist", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating the channel was not found" } } } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the internal server error" } } } } } } } } }, "/reactToMessage": { "post": { "operationId": "reactToMessage", "summary": "Adds an emoji reaction to a specific message in a Discord channel.", "description": "This function allows adding a reaction emoji to a specified message within a Discord channel. It supports both Unicode emojis and custom emoji IDs, providing flexibility in reaction options. The function returns a Promise that resolves when the reaction is successfully added.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "description": "Body of the reactToMessage sls call", "properties": { "arguments": { "type": "array", "items": [ { "type": "string", "description": "The ID of the channel containing the message", "name": "channelId" }, { "type": "string", "description": "The ID of the message to react to", "name": "messageId" }, { "type": "string", "description": "The emoji to react with (can be a Unicode emoji or a custom emoji ID)", "name": "emoji" } ] }, "auth": { "type": "object", "description": "Authentication object", "properties": { "strategy": { "type": "string", "description": "Authentication strategy", "enum": [ "apikey" ] }, "variables": { "type": "array", "description": "Variables for the authentication strategy", "items": [ { "type": "object", "properties": { "key": { "type": "string", "description": "DISCORD_BOT_TOKEN" }, "value": { "type": "string", "description": "value of DISCORD_BOT_TOKEN" } } } ] } } }, "packageName": { "type": "string", "description": "@microfox/discord" } }, "required": [ "arguments" ] } } } } } }, "responses": { "200": { "description": "Reaction successfully added", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "description": "Indicates if the reaction was successfully added" } } } } } }, "400": { "description": "Bad request - invalid parameters", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the issue with the request" } } } } } }, "404": { "description": "Not found - channel or message does not exist", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating the resource was not found" } } } } } }, "429": { "description": "Too many requests - rate limit exceeded", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating rate limit has been exceeded" }, "retry_after": { "type": "number", "description": "Number of seconds to wait before retrying the request" } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the internal server error" } } } } } } } } }, "/createThread": { "post": { "operationId": "createThread", "summary": "Creates a new thread in a Discord channel.", "description": "This function creates a thread within a specified Discord channel, branching off from a specific message. It allows users to start focused discussions on particular topics or messages within a channel, enhancing conversation organization and management.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "description": "Body of the createThread sls call", "properties": { "arguments": { "type": "array", "items": [ { "type": "string", "description": "The ID of the channel to create the thread in." }, { "type": "string", "description": "The ID of the message to create the thread from." }, { "type": "string", "description": "The name of the new thread." } ] }, "auth": { "type": "object", "description": "Authentication object", "properties": { "strategy": { "type": "string", "description": "Authentication strategy", "enum": [ "apikey" ] }, "variables": { "type": "array", "description": "Variables for the authentication strategy", "items": [ { "type": "object", "properties": { "key": { "type": "string", "description": "DISCORD_BOT_TOKEN" }, "value": { "type": "string", "description": "value of DISCORD_BOT_TOKEN" } } } ] } } }, "packageName": { "type": "string", "description": "@microfox/discord" } }, "required": [ "arguments" ] } } } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "description": "The ID of the created thread" }, "name": { "type": "string", "description": "The name of the created thread" }, "channelId": { "type": "string", "description": "The ID of the channel where the thread was created" }, "parentMessageId": { "type": "string", "description": "The ID of the message from which the thread was created" } }, "required": [ "id", "name", "channelId", "parentMessageId" ] } } } }, "400": { "description": "Bad Request - Invalid parameters", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the issue with the request" } }, "required": [ "error" ] } } } }, "403": { "description": "Forbidden - Insufficient permissions", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating lack of necessary permissions" } }, "required": [ "error" ] } } } }, "404": { "description": "Not Found - Channel or message not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating that the channel or message was not found" } }, "required": [ "error" ] } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the internal server error" } }, "required": [ "error" ] } } } } } } }, "/fetchGuildInfo": { "post": { "operationId": "fetchGuildInfo", "summary": "Fetches information about a specific Discord guild (server).", "description": "This function retrieves detailed information about a specified Discord guild using its unique identifier. It returns comprehensive data about the guild, including its name, icon, members, and channels. The function is asynchronous and returns a Promise that resolves to a guild object.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "description": "Body of the fetchGuildInfo sls call", "properties": { "arguments": { "type": "array", "items": [ { "type": "string", "description": "The ID of the guild to fetch information about.", "name": "guildId" } ] }, "auth": { "type": "object", "description": "Authentication object", "properties": { "strategy": { "type": "string", "description": "Authentication strategy", "enum": [ "apikey" ] }, "variables": { "type": "array", "description": "Variables for the authentication strategy", "items": [ { "type": "object", "properties": { "key": { "type": "string", "description": "DISCORD_BOT_TOKEN" }, "value": { "type": "string", "description": "value of DISCORD_BOT_TOKEN" } } } ] } } }, "packageName": { "type": "string", "description": "@microfox/discord" } }, "required": [ "arguments" ] } } } } } }, "responses": { "200": { "description": "Successful response with guild information", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "description": "The unique identifier of the guild" }, "name": { "type": "string", "description": "The name of the guild" }, "icon": { "type": "string", "description": "The icon hash of the guild" }, "members": { "type": "array", "items": { "type": "object", "description": "Member object" }, "description": "Array of guild members" }, "channels": { "type": "array", "items": { "type": "object", "description": "Channel object" }, "description": "Array of guild channels" } }, "required": [ "id", "name" ] } } } }, "400": { "description": "Bad request - Invalid guild ID provided", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message" } } } } } }, "404": { "description": "Guild not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message" } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message" } } } } } } } } }, "/fetchUserInfo": { "post": { "operationId": "fetchUserInfo", "summary": "Fetches information about a specific user.", "description": "This function retrieves detailed information about a user based on their user ID. It returns a Promise that resolves to a user object containing data such as username, avatar, and discriminator. The function is part of a Discord SDK and is useful for obtaining user-specific information in Discord-related applications.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "description": "Body of the fetchUserInfo sls call", "properties": { "arguments": { "type": "array", "items": [ { "type": "string", "description": "The ID of the user to fetch information about.", "name": "userId" } ] }, "auth": { "type": "object", "description": "Authentication object", "properties": { "strategy": { "type": "string", "description": "Authentication strategy", "enum": [ "apikey" ] }, "variables": { "type": "array", "description": "Variables for the authentication strategy", "items": [ { "type": "object", "properties": { "key": { "type": "string", "description": "DISCORD_BOT_TOKEN" }, "value": { "type": "string", "description": "value of DISCORD_BOT_TOKEN" } } } ] } } }, "packageName": { "type": "string", "description": "@microfox/discord" } }, "required": [ "arguments" ] } } } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "description": "The user's ID" }, "username": { "type": "string", "description": "The user's username" }, "avatar": { "type": "string", "description": "The user's avatar URL" }, "discriminator": { "type": "string", "description": "The user's discriminator" } }, "required": [ "id", "username" ] } } } }, "400": { "description": "Bad request - Invalid user ID provided", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message" } } } } } }, "404": { "description": "User not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message" } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message" } } } } } } } } }, "/registerSlashCommand": { "post": { "operationId": "registerSlashCommand", "summary": "Registers a slash command for a Discord bot in a specific guild.", "description": "This function creates and registers a new slash command for a Discord bot within a specified guild. It allows for the definition of the command's name, description, options, and permissions. The function returns a Promise that resolves to the registered command object.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "description": "Body of the registerSlashCommand sls call", "properties": { "arguments": { "type": "array", "items": [ { "type": "string", "description": "The ID of the guild to register the command in." }, { "type": "object", "description": "An object defining the command's properties.", "properties": { "name": { "type": "string", "description": "The name of the command." }, "description": { "type": "string", "description": "The description of the command." }, "options": { "type": "array", "description": "An array of options for the command.", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "The name of the option." }, "description": { "type": "string", "description": "The description of the option." }, "type": { "type": "number", "description": "The type of the option (refer to Discord API documentation for option types)." }, "required": { "type": "boolean", "description": "Whether the option is required." }, "choices": { "type": "array", "description": "An array of choices for the option.", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "The name of the choice." }, "value": { "type": [ "string", "number" ], "description": "The value of the choice." } }, "required": [ "name", "value" ] } }, "options": { "type": "array", "description": "Sub-options for subcommands.", "items": { "$ref": "#/components/schemas/DiscordSlashCommandOptionSchema" } } }, "required": [ "name", "description", "type" ] } }, "default_member_permissions": { "type": "string", "description": "Default permissions required to use the command." }, "dm_permission": { "type": "boolean", "description": "Whether the command can be used in DMs." } }, "required": [ "name", "description" ] } ] }, "auth": { "type": "object", "description": "Authentication object", "properties": { "strategy": { "type": "string", "description": "Authentication strategy", "enum": [ "apikey" ] }, "variables": { "type": "array", "description": "Variables for the authentication strategy", "items": [ { "type": "object", "properties": { "key": { "type": "string", "description": "DISCORD_BOT_TOKEN" }, "value": { "type": "string", "description": "value of DISCORD_BOT_TOKEN" } } } ] } } }, "packageName": { "type": "string", "description": "@microfox/discord" } }, "required": [ "arguments" ] } } } } } }, "responses": { "200": { "description": "Successfully registered the slash command", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "description": "The ID of the registered command" }, "application_id": { "type": "string", "description": "The ID of the application the command belongs to" }, "guild_id": { "type": "string", "description": "The ID of the guild the command is registered in" }, "name": { "type": "string", "description": "The name of the command" }, "description": { "type": "string", "description": "The description of the command" }, "options": { "type": "array", "items": { "$ref": "#/components/schemas/DiscordSlashCommandOptionSchema" }, "description": "The options of the command" }, "default_member_permissions": { "type": "string", "description": "Default permissions required to use the command" }, "dm_permission": { "type": "boolean", "description": "Whether the command can be used in DMs" }, "version": { "type": "string", "description": "The version of the command" } }, "required": [ "id", "application_id", "guild_id", "name", "description", "version" ] } } } }, "400": { "description": "Bad Request - Invalid parameters provided", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the issue with the request" } }, "required": [ "error" ] } } } }, "403": { "description": "Forbidden - Bot doesn't have permission to create slash commands in the guild", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating lack of permissions" } }, "required": [ "error" ] } } } }, "404": { "description": "Not Found - The specified guild ID does not exist", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating the guild was not found" } }, "required": [ "error" ] } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the internal server error" } }, "required": [ "error" ] } } } } } } }, "/registerGlobalSlashCommand": { "post": { "operationId": "registerGlobalSlashCommand", "summary": "Registers a global slash command for a Discord bot.", "description": "This function creates a new slash command that can be used in any guild where the bot is present. It takes a single object parameter defining the command's properties and returns a Promise that resolves to the registered command object.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "description": "Body of the registerGlobalSlashCommand sls call", "properties": { "arguments": { "type": "array", "items": [ { "type": "object", "description": "An object defining the command's properties", "properties": { "name": { "type": "string", "description": "The name of the slash command" }, "description": { "type": "string", "description": "A description of what the command does" } }, "required": [ "name", "description" ] } ] }, "auth": { "type": "object", "description": "Authentication object", "properties": { "strategy": { "type": "string", "description": "Authentication strategy", "enum": [ "apikey" ] }, "variables": { "type": "array", "description": "Variables for the authentication strategy", "items": [ { "type": "object", "properties": { "key": { "type": "string", "description": "DISCORD_BOT_TOKEN" }, "value": { "type": "string", "description": "value of DISCORD_BOT_TOKEN" } } } ] } } }, "packageName": { "type": "string", "description": "@microfox/discord" } }, "required": [ "arguments" ] } } } } } }, "responses": { "200": { "description": "Successfully registered the global slash command", "content": { "application/json": { "schema": { "type": "object", "description": "The registered command object", "properties": { "id": { "type": "string", "description": "The unique identifier of the registered command" }, "application_id": { "type": "string", "description": "The ID of the application the command belongs to" }, "name": { "type": "string", "description": "The name of the registered command" }, "description": { "type": "string", "description": "The description of the registered command" } } } } } }, "400": { "description": "Bad Request - Invalid command properties provided", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the issue with the request" } } } } } }, "401": { "description": "Unauthorized - Invalid bot token or lacking required permissions", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating authentication failure" } } } } } }, "429": { "description": "Too Many Requests - Rate limit exceeded", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating rate limit exceeded" }, "retry_after": { "type": "number", "description": "Number of seconds to wait before retrying" } } } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating a server-side issue" } } } } } } } } }, "/deleteSlashCommand": { "post": { "operationId": "deleteSlashCommand", "summary": "Deletes a slash command from a specific guild.", "description": "This function removes a previously registered slash command from a specified guild in Discord. It requires both the guild ID and the command ID to identify and delete the specific command. The operation is asynchronous and returns a Promise that resolves when the deletion is complete.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "description": "Body of the deleteSlashCommand sls call", "properties": { "arguments": { "type": "array", "items": [ { "type": "string", "description": "The ID of the guild where the command is registered.", "name": "guildId" }, { "type": "string", "description": "The ID of the command to delete.", "name": "commandId" } ] }, "auth": { "type": "object", "description": "Authentication object", "properties": { "strategy": { "type": "string", "description": "Authentication strategy", "enum": [ "apikey" ] }, "variables": { "type": "array", "description": "Variables for the authentication strategy", "items": [ { "type": "object", "properties": { "key": { "type": "string", "description": "DISCORD_BOT_TOKEN" }, "value": { "type": "string", "description": "value of DISCORD_BOT_TOKEN" } } } ] } } }, "packageName": { "type": "string", "description": "@microfox/discord" } }, "required": [ "arguments" ] } } } } } }, "responses": { "200": { "description": "Slash command successfully deleted", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Slash command deleted successfully" } } } } } }, "400": { "description": "Bad request - invalid guild ID or command ID", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "Invalid guild ID or command ID" } } } } } }, "403": { "description": "Forbidden - insufficient permissions to delete the command", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "Insufficient permissions to delete the command" } } } } } }, "404": { "description": "Not found - guild or command does not exist", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "Guild or command not found" } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "An unexpected error occurred while processing the request" } } } } } } } } }, "/deleteGlobalSlashCommand": { "post": { "operationId": "deleteGlobalSlashCommand", "summary": "Deletes a global slash command.", "description": "This function removes a previously registered global slash command from Discord. It takes the command ID as a parameter and returns a Promise that resolves when the deletion is complete. This allows for programmatic management of global slash commands in a Discord application.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "description": "Body of the deleteGlobalSlashCommand sls call", "properties": { "arguments": { "type": "array", "items": [ { "type": "string", "description": "The ID of the command to delete.", "name": "commandId" } ] }, "auth": { "type": "object", "description": "Authentication object", "properties": { "strategy": { "type": "string", "description": "Authentication strategy", "enum": [ "apikey" ] }, "variables": { "type": "array", "description": "Variables for the authentication strategy", "items": [ { "type": "object", "properties": { "key": { "type": "string", "description": "DISCORD_BOT_TOKEN" }, "value": { "type": "string", "description": "value of DISCORD_BOT_TOKEN" } } } ] } } }, "packageName": { "type": "string", "description": "@microfox/discord" } }, "required": [ "arguments" ] } } } } } }, "responses": { "200": { "description": "Command successfully deleted", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "description": "Indicates if the command was successfully deleted" } } } } } }, "400": { "description": "Bad request - invalid command ID", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the issue" } } } } } }, "404": { "description": "Command not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating the command was not found" } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the internal server error" } } } } } } } } }, "/moderateUser": { "post": { "operationId": "moderateUser", "summary": "Performs a moderation action on a user in a Discord guild.", "description": "The moderateUser function allows administrators to execute various moderation actions on users within a Discord guild. It supports actions such as banning, kicking, timing out, and warning users, with optional parameters for specifying reasons, durations, and message deletion.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "description": "Body of the moderateUser sls call", "properties": { "arguments": { "type": "array", "items": [ { "type": "string", "description": "The ID of the guild where the user is located." }, { "type": "string", "description": "The ID of the user to moderate." }, { "type": "object", "description": "The moderation action to perform.", "properties": { "type": { "type": "string", "enum": [ "ban", "kick", "timeout", "warn" ], "description": "The type of moderation action." }, "reason": { "type": "string", "description": "The reason for the moderation action." }, "duration": { "type": "number", "description": "The duration of the timeout in milliseconds." }, "delete_message_days": { "type": "number", "description": "The number of days of messages to delete (for bans)." } }, "required": [ "type" ] } ] }, "auth": { "type": "object", "description": "Authentication object", "properties": { "strategy": { "type": "string", "description": "Authentication strategy", "enum": [ "apikey" ] }, "variables": { "type": "array", "description": "Variables for the authentication strategy", "items": [ { "type": "object", "properties": { "key": { "type": "string", "description": "DISCORD_BOT_TOKEN" }, "value": { "type": "string", "description": "value of DISCORD_BOT_TOKEN" } } } ] } } }, "packageName": { "type": "string", "description": "@microfox/discord" } }, "required": [ "arguments" ] } } } } } }, "responses": { "200": { "description": "Successful moderation action", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "description": "Indicates if the moderation action was successful." }, "message": { "type": "string", "description": "A message describing the result of the moderation action." } } } } } }, "400": { "description": "Bad Request - Invalid parameters", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the issue with the request." } } } } } }, "403": { "description": "Forbidden - Insufficient permissions", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating lack of required permissions." } } } } } }, "404": { "description": "Not Found - User or guild not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating the user or guild was not found." } } } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the internal server error." } } } } } } } } }, "/createChannel": { "post": { "operationId": "createChannel", "summary": "Creates a new channel in a specified Discord guild.", "description": "This function adds a new channel to a specified Discord guild using the provided channel data. It allows for customization of various channel properties such as type, name, topic, and permissions. The function returns a Promise that resolves to the created channel object.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "description": "Body of the createChannel sls call", "properties": { "arguments": { "type": "array", "items": [ { "type": "string", "description": "The ID of the guild to create the channel in." }, { "type": "object", "description": "The channel data object containing channel properties.", "properties": { "id": { "type": "string", "description": "The channel ID." }, "type": { "type": "number", "description": "The channel type (refer to Discord API documentation for channel types)." }, "name": { "type": "string", "description": "The channel name." }, "topic": { "type": "string", "description": "The channel topic.", "optional": true }, "nsfw": { "type": "boolean", "description": "Whether the channel is NSFW.", "optional": true }, "parent_id": { "type": "string", "description": "The ID of the parent category.", "optional": true }, "permission_overwrites": { "type": "array", "description": "Permission overwrites for the channel.", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "The role or user ID." }, "type": { "type": "number", "description": "The type (0 for role, 1 for user)." }, "allow": { "type": "string", "description": "Allowed permissions.", "optional": true }, "deny": { "type": "string", "description": "Denied permissions.", "optional": true } }, "required": [ "id", "type" ] }, "optional": true }, "rate_limit_per_user": { "type": "number", "description": "Slowmode rate limit.", "optional": true }, "position": { "type": "number", "description": "Channel position.", "optional": true } }, "required": [ "id", "type", "name" ] } ] }, "auth": { "type": "object", "description": "Authentication object", "properties": { "strategy": { "type": "string", "description": "Authentication strategy", "enum": [ "apikey" ] }, "variables": { "type": "array", "description": "Variables for the authentication strategy", "items": [ { "type": "object", "properties": { "key": { "type": "string", "description": "DISCORD_BOT_TOKEN" }, "value": { "type": "string", "description": "value of DISCORD_BOT_TOKEN" } } } ] } } }, "packageName": { "type": "string", "description": "@microfox/discord" } }, "required": [ "arguments" ] } } } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "description": "The created channel object", "properties": { "id": { "type": "string", "description": "The ID of the created channel" }, "type": { "type": "number", "description": "The type of the created channel" }, "name": { "type": "string", "description": "The name of the created channel" }, "topic": { "type": "string", "description": "The topic of the created channel" }, "nsfw": { "type": "boolean", "description": "Whether the created channel is NSFW" }, "parent_id": { "type": "string", "description": "The ID of the parent category for the created channel" }, "permission_overwrites": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "The role or user ID" }, "type": { "type": "number", "description": "The type (0 for role, 1 for user)" }, "allow": { "type": "string", "description": "Allowed permissions" }, "deny": { "type": "string", "description": "Denied permissions" } } }, "description": "Permission overwrites for the created channel" }, "rate_limit_per_user": { "type": "number", "description": "Slowmode rate limit for the created channel" }, "position": { "type": "number", "description": "Position of the created channel" } } } } } }, "400": { "description": "Bad Request - Invalid parameters provided", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the issue with the request" } } } } } }, "403": { "description": "Forbidden - Insufficient permissions to create a channel", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating insufficient permissions" } } } } } }, "404": { "description": "Not Found - The specified guild does not exist", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating that the guild was not found" } } } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating a server-side issue" } } } } } } } } }, "/updateChannel": { "post": { "operationId": "updateChannel", "summary": "Updates the settings of an existing Discord channel.", "description": "This function modifies the properties of an existing Discord channel. It allows updating various channel attributes such as name, NSFW status, and other properties defined in the DiscordChannelSchema. The function takes the channel ID and a partial object containing the properties to be updated.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "description": "Body of the updateChannel sls call", "properties": { "arguments": { "type": "array", "items": [ { "type": "string", "description": "The ID of the channel to update." }, { "type": "object", "description": "The updated channel data (partial DiscordChannelSchema).", "properties": { "name": { "type": "string", "description": "The new name for the channel." }, "nsfw": { "type": "boolean", "description": "Whether the channel should be marked as NSFW." } }, "additionalProperties": true } ] }, "auth": { "type": "object", "description": "Authentication object", "properties": { "strategy": { "type": "string", "description": "Authentication strategy", "enum": [ "apikey" ] }, "variables": { "type": "array", "description": "Variables for the authentication strategy", "items": [ { "type": "object", "properties": { "key": { "type": "string", "description": "DISCORD_BOT_TOKEN" }, "value": { "type": "string", "description": "value of DISCORD_BOT_TOKEN" } } } ] } } }, "packageName": { "type": "string", "description": "@microfox/discord" } }, "required": [ "arguments" ] } } } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "description": "The updated channel object", "properties": { "id": { "type": "string", "description": "The ID of the updated channel" }, "name": { "type": "string", "description": "The name of the updated channel" }, "nsfw": { "type": "boolean", "description": "Whether the channel is marked as NSFW" } }, "additionalProperties": true } } } }, "400": { "description": "Bad Request - Invalid parameters", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the issue with the request" } } } } } }, "404": { "description": "Not Found - Channel does not exist", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating the channel was not found" } } } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the internal server error" } } } } } } } } }, "/deleteChannel": { "post": { "operationId": "deleteChannel", "summary": "Deletes a channel from a guild.", "description": "This function removes a specified channel from the guild. It takes a channel ID as input and returns a Promise that resolves when the deletion is complete. This operation is irreversible and should be used with caution.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "description": "Body of the deleteChannel sls call", "properties": { "arguments": { "type": "array", "items": [ { "type": "string", "description": "The ID of the channel to delete.", "name": "channelId" } ] }, "auth": { "type": "object", "description": "Authentication object", "properties": { "strategy": { "type": "string", "description": "Authentication strategy", "enum": [ "apikey" ] }, "variables": { "type": "array", "description": "Variables for the authentication strategy", "items": [ { "type": "object", "properties": { "key": { "type": "string", "description": "DISCORD_BOT_TOKEN" }, "value": { "type": "string", "description": "value of DISCORD_BOT_TOKEN" } } } ] } } }, "packageName": { "type": "string", "description": "@microfox/discord" } }, "required": [ "arguments" ] } } } } } }, "responses": { "200": { "description": "Channel successfully deleted", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "description": "Indicates if the channel was successfully deleted" } } } } } }, "400": { "description": "Bad request - Invalid channel ID", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the issue" } } } } } }, "403": { "description": "Forbidden - Insufficient permissions to delete the channel", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the permission issue" } } } } } }, "404": { "description": "Not Found - Channel with the given ID does not exist", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating the channel was not found" } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the server error" } } } } } } } } }, "/createRole": { "post": { "operationId": "createRole", "summary": "Creates a new role in a specified Discord guild.", "description": "This function adds a new role to a specified Discord guild with customizable properties. It allows setting various attributes of the role such as name, color, permissions, and position. The function returns a Promise that resolves to the created role object.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "description": "Body of the createRole sls call", "properties": { "arguments": { "type": "array", "items": [ { "type": "string", "description": "The ID of the guild to create the role in." }, { "type": "object", "description": "The role data object containing role properties.", "properties": { "id": { "type": "string", "description": "The role ID." }, "name": { "type": "string", "description": "The role name." }, "color": { "type": "integer", "description": "The role color." }, "hoist": { "type": "boolean", "description": "Whether the role is hoisted." }, "position": { "type": "integer", "description": "The role position." }, "permissions": { "type": "string", "description": "The role permissions." }, "mentionable": { "type": "boolean", "description": "Whether the role is mentionable." }, "managed": { "type": "boolean", "description": "Whether the role is managed." }, "description": { "type": "string", "description": "The role description.", "optional": true } }, "required": [ "id", "name", "color", "hoist", "position", "permissions", "mentionable", "managed" ] } ] }, "auth": { "type": "object", "description": "Authentication object", "properties": { "strategy": { "type": "string", "description": "Authentication strategy", "enum": [ "apikey" ] }, "variables": { "type": "array", "description": "Variables for the authentication strategy", "items": [ { "type": "object", "properties": { "key": { "type": "string", "description": "DISCORD_BOT_TOKEN" }, "value": { "type": "string", "description": "value of DISCORD_BOT_TOKEN" } } } ] } } }, "packageName": { "type": "string", "description": "@microfox/discord" } }, "required": [ "arguments" ] } } } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "description": "The ID of the created role" }, "name": { "type": "string", "description": "The name of the created role" }, "color": { "type": "integer", "description": "The color of the created role" }, "hoist": { "type": "boolean", "description": "Whether the created role is hoisted" }, "position": { "type": "integer", "description": "The position of the created role" }, "permissions": { "type": "string", "description": "The permissions of the created role" }, "mentionable": { "type": "boolean", "description": "Whether the created role is mentionable" }, "managed": { "type": "boolean", "description": "Whether the created role is managed" }, "description": { "type": "string", "description": "The description of the created role (if provided)" } }, "required": [ "id", "name", "color", "hoist", "position", "permissions", "mentionable", "managed" ] } } } }, "400": { "description": "Bad Request - Invalid input parameters", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the issue with the request" } } } } } }, "403": { "description": "Forbidden - Insufficient permissions to create a role", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating insufficient permissions" } } } } } }, "404": { "description": "Not Found - Guild not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating the guild was not found" } } } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the internal server error" } } } } } } } } }, "/updateRole": { "post": { "operationId": "updateRole", "summary": "Updates the settings of an existing role in a Discord guild.", "description": "This function modifies the properties of an existing role within a specified Discord guild. It allows updating various attributes of the role such as name, color, permissions, etc. The function returns a Promise that resolves to the updated role object.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "description": "Body of the updateRole sls call", "properties": { "arguments": { "type": "array", "items": [ { "type": "string", "description": "The ID of the guild containing the role." }, { "type": "string", "description": "The ID of the role to update." }, { "type": "object", "description": "The updated role data (partial object with properties to be updated).", "properties": { "name": { "type": "string", "description": "The new name for the role." }, "color": { "type": "integer", "description": "The new color for the role, as an integer representation of hexadecimal color code." } }, "additionalProperties": true } ] }, "auth": { "type": "object", "description": "Authentication object", "properties": { "strategy": { "type": "string", "description": "Authentication strategy", "enum": [ "apikey" ] }, "variables": { "type": "array", "description": "Variables for the authentication strategy", "items": [ { "type": "object", "properties": { "key": { "type": "string", "description": "DISCORD_BOT_TOKEN" }, "value": { "type": "string", "description": "value of DISCORD_BOT_TOKEN" } } } ] } } }, "packageName": { "type": "string", "description": "@microfox/discord" } }, "required": [ "arguments" ] } } } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "description": "The updated role object", "properties": { "id": { "type": "string", "description": "The ID of the updated role" }, "name": { "type": "string", "description": "The name of the updated role" }, "color": { "type": "integer", "description": "The color of the updated role" } }, "additionalProperties": true } } } }, "400": { "description": "Bad Request - Invalid parameters provided", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the issue with the request" } } } } } }, "403": { "description": "Forbidden - Insufficient permissions to update the role", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating insufficient permissions" } } } } } }, "404": { "description": "Not Found - Guild or role not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating the guild or role was not found" } } } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the internal server error" } } } } } } } } }, "/deleteRole": { "post": { "operationId": "deleteRole", "summary": "Delete a role from a guild in Discord.", "description": "This function removes a specified role from a Discord guild. It takes the guild ID and role ID as parameters and returns a Promise that resolves when the role is successfully deleted. This operation is irreversible and should be used with caution.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "description": "Body of the deleteRole sls call", "properties": { "arguments": { "type": "array", "items": [ { "type": "string", "description": "The ID of the guild containing the role.", "name": "guildId" }, { "type": "string", "description": "The ID of the role to delete.", "name": "roleId" } ] }, "auth": { "type": "object", "description": "Authentication object", "properties": { "strategy": { "type": "string", "description": "Authentication strategy", "enum": [ "apikey" ] }, "variables": { "type": "array", "description": "Variables for the authentication strategy", "items": [ { "type": "object", "properties": { "key": { "type": "string", "description": "DISCORD_BOT_TOKEN" }, "value": { "type": "string", "description": "value of DISCORD_BOT_TOKEN" } } } ] } } }, "packageName": { "type": "string", "description": "@microfox/discord" } }, "required": [ "arguments" ] } } } } } }, "responses": { "200": { "description": "Role successfully deleted", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Role deleted successfully" } } } } } }, "400": { "description": "Bad request - invalid guild ID or role ID", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "Invalid guild ID or role ID" } } } } } }, "403": { "description": "Forbidden - insufficient permissions to delete the role", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "Insufficient permissions to delete the role" } } } } } }, "404": { "description": "Not found - guild or role does not exist", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "Guild or role not found" } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "An unexpected error occurred" } } } } } } } } }, "/addRoleToUser": { "post": { "operationId": "addRoleToUser", "summary": "Adds a role to a user in a Discord guild.", "description": "This function assigns a specific role to a user within a Discord guild. It takes the guild ID, user ID, and role ID as required parameters, with an optional reason for audit log purposes. The function returns a Promise that resolves when the role is successfully added to the user.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "description": "Body of the addRoleToUser sls call", "properties": { "arguments": { "type": "array", "items": [ { "type": "string", "description": "The ID of the guild where the user and role are located." }, { "type": "string", "description": "The ID of the user to add the role to." }, { "type": "string", "description": "The ID of the role to add." }, { "type": "string", "description": "The reason for adding the role (audit log purposes).", "optional": true } ] }, "auth": { "type": "object", "description": "Authentication object", "properties": { "strategy": { "type": "string", "description": "Authentication strategy", "enum": [ "apikey" ] }, "variables": { "type": "array", "description": "Variables for the authentication strategy", "items": [ { "type": "object", "properties": { "key": { "type": "string", "description": "DISCORD_BOT_TOKEN" }, "value": { "type": "string", "description": "value of DISCORD_BOT_TOKEN" } } } ] } } }, "packageName": { "type": "string", "description": "@microfox/discord" } }, "required": [ "arguments" ] } } } } } }, "responses": { "200": { "description": "Role successfully added to the user", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "description": "Indicates if the role was successfully added" }, "message": { "type": "string", "description": "A message confirming the role addition" } } } } } }, "400": { "description": "Bad Request - Invalid input parameters", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the issue with the request" } } } } } }, "403": { "description": "Forbidden - Insufficient permissions to add the role", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating insufficient permissions" } } } } } }, "404": { "description": "Not Found - Guild, user, or role not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating the resource was not found" } } } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the internal server error" } } } } } } } } }, "/removeRoleFromUser": { "post": { "operationId": "removeRoleFromUser", "summary": "Removes a specific role from a user in a guild.", "description": "This function revokes a designated role from a user within a specified guild. It allows for optional audit log documentation by providing a reason for the role removal. The function returns a Promise that resolves upon successful role removal.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "description": "Body of the removeRoleFromUser sls call", "properties": { "arguments": { "type": "array", "items": [ { "type": "string", "description": "The ID of the guild where the user and role are located." }, { "type": "string", "description": "The ID of the user to remove the role from." }, { "type": "string", "description": "The ID of the role to remove." }, { "type": "string", "description": "The reason for removing the role (audit log purposes).", "optional": true } ] }, "auth": { "type": "object", "description": "Authentication object", "properties": { "strategy": { "type": "string", "description": "Authentication strategy", "enum": [ "apikey" ] }, "variables": { "type": "array", "description": "Variables for the authentication strategy", "items": [ { "type": "object", "properties": { "key": { "type": "string", "description": "DISCORD_BOT_TOKEN" }, "value": { "type": "string", "description": "value of DISCORD_BOT_TOKEN" } } } ] } } }, "packageName": { "type": "string", "description": "@microfox/discord" } }, "required": [ "arguments" ] } } } } } }, "responses": { "200": { "description": "Role successfully removed from the user.", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "description": "Indicates if the role was successfully removed." } } } } } }, "400": { "description": "Bad request. This could occur if the provided IDs are invalid or if the user doesn't have the specified role.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the issue with the request." } } } } } }, "403": { "description": "Forbidden. The bot doesn't have the necessary permissions to remove roles.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating insufficient permissions." } } } } } }, "404": { "description": "Not Found. The specified guild, user, or role doesn't exist.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating the resource was not found." } } } } } }, "500": { "description": "Internal server error. An unexpected error occurred while processing the request.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the internal server error." } } } } } } } } }, "/fetchChannels": { "post": { "operationId": "fetchChannels", "summary": "Fetches all channels in a specified guild.", "description": "This function retrieves a list of all channels within a specific guild on Discord. It takes a guild ID as input and returns a Promise that resolves to an array of channel objects. This can be useful for obtaining information about the structure and available communication channels within a particular Discord server.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "description": "Body of the fetchChannels sls call", "properties": { "arguments": { "type": "array", "items": [ { "type": "string", "description": "The ID of the guild to fetch channels from.", "name": "guildId" } ] }, "auth": { "type": "object", "description": "Authentication object", "properties": { "strategy": { "type": "string", "description": "Authentication strategy", "enum": [ "apikey" ] }, "variables": { "type": "array", "description": "Variables for the authentication strategy", "items": [ { "type": "object", "properties": { "key": { "type": "string", "description": "DISCORD_BOT_TOKEN" }, "value": { "type": "string", "description": "value of DISCORD_BOT_TOKEN" } } } ] } } }, "packageName": { "type": "string", "description": "@microfox/discord" } }, "required": [ "arguments" ] } } } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "description": "Channel object", "properties": { "id": { "type": "string", "description": "The ID of the channel" }, "name": { "type": "string", "description": "The name of the channel" }, "type": { "type": "integer", "description": "The type of the channel" } } } } } } }, "400": { "description": "Bad Request - Invalid guild ID", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message" } } } } } }, "403": { "description": "Forbidden - Insufficient permissions to access the guild", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message" } } } } } }, "404": { "description": "Not Found - Guild not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message" } } } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message" } } } } } } } } }, "/fetchRoles": { "post": { "operationId": "fetchRoles", "summary": "Fetches all roles in a Discord guild.", "description": "This function retrieves a list of all roles within a specific Discord guild. It takes a guild ID as input and returns a Promise that resolves to an array of role objects. This can be useful for managing permissions, displaying role information, or performing role-based operations within a Discord bot or application.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "description": "Body of the fetchRoles sls call", "properties": { "arguments": { "type": "array", "items": [ { "type": "string", "description": "The ID of the guild to fetch roles from.", "name": "guildId" } ] }, "auth": { "type": "object", "description": "Authentication object", "properties": { "strategy": { "type": "string", "description": "Authentication strategy", "enum": [ "apikey" ] }, "variables": { "type": "array", "description": "Variables for the authentication strategy", "items": [ { "type": "object", "properties": { "key": { "type": "string", "description": "DISCORD_BOT_TOKEN" }, "value": { "type": "string", "description": "value of DISCORD_BOT_TOKEN" } } } ] } } }, "packageName": { "type": "string", "description": "@microfox/discord" } }, "required": [ "arguments" ] } } } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "description": "Role object", "properties": { "id": { "type": "string", "description": "The ID of the role" }, "name": { "type": "string", "description": "The name of the role" }, "color": { "type": "integer", "description": "The color of the role" }, "hoist": { "type": "boolean", "description": "Whether the role is hoisted" }, "position": { "type": "integer", "description": "The position of the role" }, "permissions": { "type": "string", "description": "The permissions of the role as a string" }, "managed": { "type": "boolean", "description": "Whether the role is managed by an integration" }, "mentionable": { "type": "boolean", "description": "Whether the role is mentionable" } } } } } } }, "400": { "description": "Bad Request - Invalid guild ID provided", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message" } } } } } }, "403": { "description": "Forbidden - Bot lacks permissions to fetch roles", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message" } } } } } }, "404": { "description": "Not Found - Guild not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message" } } } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message" } } } } } } } } }, "/fetchSlashCommands": { "post": { "operationId": "fetchSlashCommands", "summary": "Fetches all slash commands for a specific guild.", "description": "This function retrieves a list of all slash commands registered for the bot in a specified guild. It takes the guild ID as a parameter and returns a Promise that resolves to an array of slash command objects. This allows developers to inspect and manage the bot's slash commands for a particular guild.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "description": "Body of the fetchSlashCommands sls call", "properties": { "arguments": { "type": "array", "items": [ { "type": "string", "description": "The ID of the guild to fetch commands from.", "name": "guildId" } ] }, "auth": { "type": "object", "description": "Authentication object", "properties": { "strategy": { "type": "string", "description": "Authentication strategy", "enum": [ "apikey" ] }, "variables": { "type": "array", "description": "Variables for the authentication strategy", "items": [ { "type": "object", "properties": { "key": { "type": "string", "description": "DISCORD_BOT_TOKEN" }, "value": { "type": "string", "description": "value of DISCORD_BOT_TOKEN" } } } ] } } }, "packageName": { "type": "string", "description": "@microfox/discord" } }, "required": [ "arguments" ] } } } } } }, "responses": { "200": { "description": "Successfully fetched slash commands", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "description": "Slash command object", "properties": { "id": { "type": "string", "description": "The unique identifier of the slash command" }, "name": { "type": "string", "description": "The name of the slash command" }, "description": { "type": "string", "description": "A description of what the slash command does" }, "options": { "type": "array", "items": { "type": "object", "description": "Command options" }, "description": "An array of command options" } } } } } } }, "400": { "description": "Bad request - Invalid guild ID provided", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message" } } } } } }, "403": { "description": "Forbidden - Bot does not have permission to access guild commands", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message" } } } } } }, "404": { "description": "Not Found - Guild not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message" } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message" } } } } } } } } }, "/fetchGlobalSlashCommands": { "post": { "operationId": "fetchGlobalSlashCommands", "summary": "Fetches all global slash commands for the bot.", "description": "This function retrieves a list of all global slash commands registered for the bot. It returns a Promise that resolves to an array of slash command objects. This allows developers to easily access and manage the bot's global slash commands.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "description": "Body of the fetchGlobalSlashCommands sls call", "properties": { "arguments": { "type": "array", "items": [] }, "auth": { "type": "object", "description": "Authentication object", "properties": { "strategy": { "type": "string", "description": "Authentication strategy", "enum": [ "apikey" ] }, "variables": { "type": "array", "description": "Variables for the authentication strategy", "items": [ { "type": "object", "properties": { "key": { "type": "string", "description": "DISCORD_BOT_TOKEN" }, "value": { "type": "string", "description": "value of DISCORD_BOT_TOKEN" } } } ] } } }, "packageName": { "type": "string", "description": "@microfox/discord" } }, "required": [ "arguments" ] } } } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "description": "Slash command object", "properties": { "id": { "type": "string", "description": "Unique identifier for the slash command" }, "name": { "type": "string", "description": "Name of the slash command" }, "description": { "type": "string", "description": "Description of the slash command" }, "options": { "type": "array", "items": { "type": "object", "description": "Command options" }, "description": "Array of command options" } } } } } } }, "400": { "description": "Bad Request - Client error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the bad request" } } } } } }, "401": { "description": "Unauthorized - Authentication failed", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating authentication failure" } } } } } }, "403": { "description": "Forbidden - Insufficient permissions", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating insufficient permissions" } } } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the server error" } } } } } } } } }, "/registerCommand": { "post": { "operationId": "registerCommand", "summary": "Registers a command handler for a specific slash command in a Discord guild.", "description": "This function registers a function to handle a specific slash command in a Discord guild. It allows for the creation of custom commands with various options and permissions. The function returns a Promise that resolves when the command is successfully registered.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "description": "Body of the registerCommand sls call", "properties": { "arguments": { "type": "array", "items": [ { "type": "string", "description": "The ID of the guild to register the command in." }, { "type": "object", "description": "The command handler data.", "properties": { "name": { "type": "string", "description": "The name of the command." }, "description": { "type": "string", "description": "The description of the command." }, "options": { "type": "array", "items": { "type": "object", "description": "DiscordSlashCommandOptionSchema" }, "description": "An array of options for the command (same structure as in `registerSlashCommand`)." }, "handler": { "type": "object", "description": "The function to handle the command interaction.", "properties": { "interaction": { "type": "object", "description": "DiscordSlashCommandInteractionSchema" }, "options": { "type": "object", "description": "An object containing the values of the command options." } }, "required": [ "interaction", "options" ] }, "default_member_permissions": { "type": "string", "description": "Default permissions required to use the command." }, "dm_permission": { "type": "boolean", "description": "Whether the command can be used in DMs." } }, "required": [ "name", "description", "handler" ] } ] }, "auth": { "type": "object", "description": "Authentication object", "properties": { "strategy": { "type": "string", "description": "Authentication strategy", "enum": [ "apikey" ] }, "variables": { "type": "array", "description": "Variables for the authentication strategy", "items": [ { "type": "object", "properties": { "key": { "type": "string", "description": "DISCORD_BOT_TOKEN" }, "value": { "type": "string", "description": "value of DISCORD_BOT_TOKEN" } } } ] } } }, "packageName": { "type": "string", "description": "@microfox/discord" } }, "required": [ "arguments" ] } } } } } }, "responses": { "200": { "description": "Command successfully registered", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "description": "Indicates if the command was successfully registered" }, "message": { "type": "string", "description": "A message confirming the registration" } } } } } }, "400": { "description": "Bad Request - Invalid parameters", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the issue with the request" } } } } } }, "403": { "description": "Forbidden - Insufficient permissions", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating insufficient permissions" } } } } } }, "404": { "description": "Not Found - Guild not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating the guild was not found" } } } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the internal server error" } } } } } } } } }, "/registerGlobalCommand": { "post": { "operationId": "registerGlobalCommand", "summary": "Registers a global command handler for Discord slash commands.", "description": "This function registers a function to handle a specific global slash command in Discord. It takes a command handler object as a parameter and returns a Promise that resolves when the command is successfully registered. The function allows developers to define custom global commands that can be used across all guilds where the bot is present.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "description": "Body of the registerGlobalCommand sls call", "properties": { "arguments": { "type": "array", "items": [ { "type": "object", "description": "The command handler data", "properties": { "name": { "type": "string", "description": "The name of the global command" }, "description": { "type": "string", "description": "A description of what the command does" }, "handler": { "type": "function", "description": "An async function that handles the command interaction" } }, "required": [ "name", "description", "handler" ] } ] }, "auth": { "type": "object", "description": "Authentication object", "properties": { "strategy": { "type": "string", "description": "Authentication strategy", "enum": [ "apikey" ] }, "variables": { "type": "array", "description": "Variables for the authentication strategy", "items": [ { "type": "object", "properties": { "key": { "type": "string", "description": "DISCORD_BOT_TOKEN" }, "value": { "type": "string", "description": "value of DISCORD_BOT_TOKEN" } } } ] } } }, "packageName": { "type": "string", "description": "@microfox/discord" } }, "required": [ "arguments" ] } } } } } }, "responses": { "200": { "description": "Command registered successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "description": "Indicates if the command was registered successfully" }, "message": { "type": "string", "description": "A message confirming the registration" } } } } } }, "400": { "description": "Bad request - invalid command data", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the issue with the request" } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the internal server error" } } } } } } } } }, "/handleInteraction": { "post": { "operationId": "handleInteraction", "summary": "Handles a slash command interaction in a Discord bot.", "description": "This function processes a slash command interaction received from Discord. It retrieves the corresponding command handler for the interaction and executes it, managing the lifecycle of slash command interactions in a Discord bot.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "description": "Body of the handleInteraction sls call", "properties": { "arguments": { "type": "array", "items": [ { "type": "object", "description": "The raw interaction object received from Discord", "properties": { "isChatInputCommand": { "type": "function", "description": "Function to check if the interaction is a chat input command" } }, "required": [ "isChatInputCommand" ] } ] }, "auth": { "type": "object", "description": "Authentication object", "properties": { "strategy": { "type": "string", "description": "Authentication strategy", "enum": [ "apikey" ] }, "variables": { "type": "array", "description": "Variables for the authentication strategy", "items": [ { "type": "object", "properties": { "key": { "type": "string", "description": "DISCORD_BOT_TOKEN" }, "value": { "type": "string", "description": "value of DISCORD_BOT_TOKEN" } } } ] } } }, "packageName": { "type": "string", "description": "@microfox/discord" } }, "required": [ "arguments" ] } } } } } }, "responses": { "200": { "description": "Interaction handled successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "description": "Indicates if the interaction was handled successfully" }, "message": { "type": "string", "description": "A message describing the result of the interaction handling" } } } } } }, "400": { "description": "Bad request - invalid interaction object", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the issue with the request" } } } } } }, "404": { "description": "Command handler not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating that the command handler was not found" } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the internal server error" } } } } } } } } }, "/respondToInteraction": { "post": { "operationId": "respondToInteraction", "summary": "Responds to a slash command interaction in Discord.", "description": "This function sends a response back to the user who interacted with a slash command in Discord. It allows for customization of the response content, including text, embeds, and components, with an option to make the response ephemeral. The function returns a Promise that resolves when the response is successfully sent.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "description": "Body of the respondToInteraction sls call", "properties": { "arguments": { "type": "array", "items": [ { "type": "string", "description": "The interaction token received from Discord." }, { "type": "object", "description": "The response data object containing various optional properties.", "properties": { "content": { "type": "string", "description": "The text content of the response." }, "embeds": { "type": "array", "description": "An array of embed objects.", "items": { "type": "object" } }, "components": { "type": "array", "description": "An array of component objects (buttons, menus, etc.).", "items": { "type": "object" } }, "ephemeral": { "type": "boolean", "description": "Whether the response should be ephemeral (only visible to the user who triggered the command)." } } } ] }, "auth": { "type": "object", "description": "Authentication object", "properties": { "strategy": { "type": "string", "description": "Authentication strategy", "enum": [ "apikey" ] }, "variables": { "type": "array", "description": "Variables for the authentication strategy", "items": [ { "type": "object", "properties": { "key": { "type": "string", "description": "DISCORD_BOT_TOKEN" }, "value": { "type": "string", "description": "value of DISCORD_BOT_TOKEN" } } } ] } } }, "packageName": { "type": "string", "description": "@microfox/discord" } }, "required": [ "arguments" ] } } } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "description": "Indicates if the response was sent successfully." } } } } } }, "400": { "description": "Bad Request - Invalid parameters", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the issue with the request." } } } } } }, "401": { "description": "Unauthorized - Invalid interaction token", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating an invalid or expired interaction token." } } } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the internal server error." } } } } } } } } }, "/deferInteraction": { "post": { "operationId": "deferInteraction", "summary": "Defers a slash command response in Discord.", "description": "This function acknowledges a Discord slash command interaction and allows the bot more time to process the command. It takes an interaction token and an optional parameter to set the response as ephemeral. The function returns a Promise that resolves when the interaction is successfully deferred.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "description": "Body of the deferInteraction sls call", "properties": { "arguments": { "type": "array", "items": [ { "type": "string", "description": "The interaction token received from Discord." }, { "type": "boolean", "description": "Whether the deferred response should be ephemeral.", "optional": true } ] }, "auth": { "type": "object", "description": "Authentication object", "properties": { "strategy": { "type": "string", "description": "Authentication strategy", "enum": [ "apikey" ] }, "variables": { "type": "array", "description": "Variables for the authentication strategy", "items": [ { "type": "object", "properties": { "key": { "type": "string", "description": "DISCORD_BOT_TOKEN" }, "value": { "type": "string", "description": "value of DISCORD_BOT_TOKEN" } } } ] } } }, "packageName": { "type": "string", "description": "@microfox/discord" } }, "required": [ "arguments" ] } } } } } }, "responses": { "200": { "description": "Interaction successfully deferred", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "description": "Indicates if the interaction was successfully deferred" } } } } } }, "400": { "description": "Bad request - invalid interaction token or parameters", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the issue" } } } } } }, "401": { "description": "Unauthorized - invalid or expired interaction token", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating unauthorized access" } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the internal server error" } } } } } } } } }, "/followUpInteraction": { "post": { "operationId": "followUpInteraction", "summary": "Sends a follow-up message to a deferred Discord interaction.", "description": "This function allows sending a follow-up message after a Discord interaction has been deferred. It takes an interaction token and a response object to construct and send the follow-up message. The function is useful for scenarios where the initial response to an interaction was delayed and additional information needs to be sent.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "description": "Body of the followUpInteraction sls call", "properties": { "arguments": { "type": "array", "items": [ { "type": "string", "description": "The interaction token received from Discord" }, { "type": "object", "description": "The response data (same structure as in `respondToInteraction`)", "properties": { "content": { "type": "string", "description": "The content of the follow-up message" } } } ] }, "auth": { "type": "object", "description": "Authentication object", "properties": { "strategy": { "type": "string", "description": "Authentication strategy", "enum": [ "apikey" ] }, "variables": { "type": "array", "description": "Variables for the authentication strategy", "items": [ { "type": "object", "properties": { "key": { "type": "string", "description": "DISCORD_BOT_TOKEN" }, "value": { "type": "string", "description": "value of DISCORD_BOT_TOKEN" } } } ] } } }, "packageName": { "type": "string", "description": "@microfox/discord" } }, "required": [ "arguments" ] } } } } } }, "responses": { "200": { "description": "Follow-up message sent successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "description": "Indicates if the follow-up message was sent successfully" } } } } } }, "400": { "description": "Bad request - invalid parameters", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the issue with the request" } } } } } }, "401": { "description": "Unauthorized - invalid interaction token", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message indicating an invalid or expired interaction token" } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message describing the internal server error" } } } } } } } } } } }