export type SnowflakeType = unknown; export type CreateApiChannelsChannelIdMessagesBulkDeleteArgs = {body: {messages: Array}}; export type CreateApiChannelsChannelIdMessagesBulkDeleteOptions = {baseUrl?: string | undefined, BotToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /channels/{channel_id}/messages/bulk-delete */ export const createApiChannelsChannelIdMessagesBulkDelete = async (args: CreateApiChannelsChannelIdMessagesBulkDeleteArgs, options?: CreateApiChannelsChannelIdMessagesBulkDeleteOptions) => { const {baseUrl = "https://discord.com/api/v10", fetch: fetchFn = fetch, BotToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (BotToken !== undefined) headers.set("Authorization", BotToken) const url = `${baseUrl.replace(/\/+$/, '')}/channels/${encodeURIComponent(String(args.channel_id))}/messages/bulk-delete${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };