// Generated by notion tool-core codegen-script-types --connections. Do not edit. import type { ConnectionActionInvoker } from "./connection-actions.js" /** * Script input for the "Add Discord reaction" effect (`discord.addReaction`), * derived from its Tool Core definition's call_function input projection. * * Add a reaction to a Discord message */ export type AddReactionScriptInput = { /** * The Discord channel ID containing the message. */ channelId: string /** * The Discord message ID to react to. */ messageId: string /** * The emoji to react with. Use Unicode emoji (e.g. "👍") or custom emoji in the format "name:id" (e.g. "notionlogo:123456789"). */ emoji: string } /** * Canonical Tool Core output for the "Add Discord reaction" effect (`discord.addReaction`). * This is the definition's output schema; the effect's script surface may * re-encode it before returning. */ export type AddReactionScriptOutput = Record /** * Script input for the "Get recent Discord channel messages" effect (`discord.getRecentChannelMessages`), * derived from its Tool Core definition's call_function input projection. * * Get recent messages from a Discord channel */ export type GetRecentChannelMessagesScriptInput = { /** * The Discord channel ID to read messages from. */ channelId: string /** * Number of messages to retrieve (1-50, default 25). */ limit?: number } /** * Canonical Tool Core output for the "Get recent Discord channel messages" effect (`discord.getRecentChannelMessages`). * This is the definition's output schema; the effect's script surface may * re-encode it before returning. */ export type GetRecentChannelMessagesScriptOutput = Array<{ /** * The Discord message ID (snowflake). */ id: string /** * The Discord channel ID containing the message. */ channelId: string /** * The Discord guild (server) ID. */ guildId: string /** * The Discord markdown message content. */ content: string /** * Whether the message was sent by the bot. */ fromBot: boolean /** * The message timestamp in ISO 8601 format. */ timestamp: string /** * A user-navigable URL to the message. */ url: string /** * The channel name, when available. */ channelName?: string }> /** * Script input for the "List Discord channels" effect (`discord.listChannels`), * derived from its Tool Core definition's call_function input projection. * * List text channels in the Discord server */ export type ListChannelsScriptInput = Record /** * Canonical Tool Core output for the "List Discord channels" effect (`discord.listChannels`). * This is the definition's output schema; the effect's script surface may * re-encode it before returning. */ export type ListChannelsScriptOutput = Array<{ /** * The Discord channel ID (snowflake). */ id: string /** * The channel name. */ name: string /** * The channel type: "text", "announcement", "forum", or "media". */ type: string }> /** * Script input for the "Remove Discord reaction" effect (`discord.removeReaction`), * derived from its Tool Core definition's call_function input projection. * * Remove a reaction from a Discord message */ export type RemoveReactionScriptInput = { /** * The Discord channel ID containing the message. */ channelId: string /** * The Discord message ID to remove the reaction from. */ messageId: string /** * The emoji to remove. Use Unicode emoji (e.g. "👍") or custom emoji in the format "name:id" (e.g. "notionlogo:123456789"). */ emoji: string } /** * Canonical Tool Core output for the "Remove Discord reaction" effect (`discord.removeReaction`). * This is the definition's output schema; the effect's script surface may * re-encode it before returning. */ export type RemoveReactionScriptOutput = Record /** * Script input for the "Send Discord channel message" effect (`discord.sendMessageToChannel`), * derived from its Tool Core definition's call_function input projection. * * Send a new message to a Discord channel */ export type SendMessageToChannelScriptInput = { /** * The Discord channel ID (snowflake) to send the message to. */ channelId: string /** * ## Follow these guidelines when sending Discord messages: * **Response Length:** * - Keep responses to 1-2 short sentences maximum * - No long paragraphs or blocks of text * - Break longer content into bullets or line breaks * - Every response must be instantly scannable * * **Tone:** * - Write like a friendly human co-worker * - Be concise and direct * * **Formatting:** * - Use standard Discord markdown * - Use bullets for lists * - Use **bold** for emphasis * - Use line breaks for clarity * - Emojis allowed sparingly for clarity or tone * * **Links:** * - Always use markdown link syntax: [link text](url) * - Never use raw URLs */ content: string } /** * Canonical Tool Core output for the "Send Discord channel message" effect (`discord.sendMessageToChannel`). * This is the definition's output schema; the effect's script surface may * re-encode it before returning. */ export type SendMessageToChannelScriptOutput = { /** * The Discord message ID (snowflake). */ id: string /** * The Discord channel ID containing the message. */ channelId: string /** * The Discord guild (server) ID. */ guildId: string /** * The Discord markdown message content. */ content: string /** * Whether the message was sent by the bot. */ fromBot: boolean /** * The message timestamp in ISO 8601 format. */ timestamp: string /** * A user-navigable URL to the message. */ url: string /** * The channel name, when available. */ channelName?: string } /** * Script input for the "Update Discord message" effect (`discord.updateMessage`), * derived from its Tool Core definition's call_function input projection. * * Update an existing Discord message */ export type UpdateMessageScriptInput = { /** * The Discord channel ID containing the message. */ channelId: string /** * The Discord message ID to update. */ messageId: string /** * The new content for the message (Discord markdown). */ content: string } /** * Canonical Tool Core output for the "Update Discord message" effect (`discord.updateMessage`). * This is the definition's output schema; the effect's script surface may * re-encode it before returning. */ export type UpdateMessageScriptOutput = { /** * The Discord message ID (snowflake). */ id: string /** * The Discord channel ID containing the message. */ channelId: string /** * The Discord guild (server) ID. */ guildId: string /** * The Discord markdown message content. */ content: string /** * Whether the message was sent by the bot. */ fromBot: boolean /** * The message timestamp in ISO 8601 format. */ timestamp: string /** * A user-navigable URL to the message. */ url: string /** * The channel name, when available. */ channelName?: string } export class DiscordConnectionClient { constructor(private readonly invoke: ConnectionActionInvoker) {} addReaction(args: AddReactionScriptInput): Promise { return this.invoke("addReaction", args) } getRecentChannelMessages( args: GetRecentChannelMessagesScriptInput, ): Promise { return this.invoke( "getRecentChannelMessages", args, ) } listChannels( args: ListChannelsScriptInput, ): Promise { return this.invoke("listChannels", args) } removeReaction( args: RemoveReactionScriptInput, ): Promise { return this.invoke("removeReaction", args) } sendMessageToChannel( args: SendMessageToChannelScriptInput, ): Promise { return this.invoke( "sendMessageToChannel", args, ) } updateMessage( args: UpdateMessageScriptInput, ): Promise { return this.invoke("updateMessage", args) } }