From 068ecf897bb7551d73352ca46bf1bfbb6e85d9e1 Mon Sep 17 00:00:00 2001 From: Fleny Date: Thu, 31 Jul 2025 21:05:31 +0200 Subject: [PATCH] api-docs!: Remove deleteGuild & EditGuild.ownerId (#4269) * Remove deleteGuild & EditGuild.ownerId * Change E2E test --- packages/bot/src/helpers.ts | 4 ---- packages/bot/tests/e2e/resetguilds.spec.ts | 27 +++------------------- packages/rest/src/manager.ts | 4 ---- packages/rest/src/types.ts | 13 ----------- packages/types/src/discordeno.ts | 2 -- 5 files changed, 3 insertions(+), 47 deletions(-) diff --git a/packages/bot/src/helpers.ts b/packages/bot/src/helpers.ts index d5f861380..74b58b1ce 100644 --- a/packages/bot/src/helpers.ts +++ b/packages/bot/src/helpers.ts @@ -671,9 +671,6 @@ export function createBotHelpers { return await bot.rest.deleteGlobalApplicationCommand(commandId) }, - deleteGuild: async (guildId) => { - return await bot.rest.deleteGuild(guildId) - }, deleteGuildApplicationCommand: async (commandId, guildId) => { return await bot.rest.deleteGuildApplicationCommand(commandId, guildId) }, @@ -1123,7 +1120,6 @@ export type BotHelpers Promise deleteFollowupMessage: (token: string, messageId: BigString) => Promise deleteGlobalApplicationCommand: (commandId: BigString) => Promise - deleteGuild: (guildId: BigString) => Promise deleteGuildApplicationCommand: (commandId: BigString, guildId: BigString) => Promise deleteGuildSticker: (guildId: BigString, stickerId: BigString, reason?: string) => Promise deleteGuildTemplate: (guildId: BigString, templateCode: string) => Promise diff --git a/packages/bot/tests/e2e/resetguilds.spec.ts b/packages/bot/tests/e2e/resetguilds.spec.ts index 1ec5c8771..c12857194 100644 --- a/packages/bot/tests/e2e/resetguilds.spec.ts +++ b/packages/bot/tests/e2e/resetguilds.spec.ts @@ -1,5 +1,4 @@ -import { Intents } from '@discordeno/types' -import { delay, logger } from '@discordeno/utils' +import { delay } from '@discordeno/utils' import { use as chaiUse } from 'chai' import chaiAsPromised from 'chai-as-promised' import { describe, it } from 'mocha' @@ -7,30 +6,10 @@ import { createBot } from '../../src/bot.js' import { token } from './constants.js' chaiUse(chaiAsPromised) -describe('[Bot] Delete any guild owned guilds', () => { - it('Start the bot', async () => { +describe('[Bot] Can start and stop the bot', () => { + it('Start and stop the bot', async () => { const bot = createBot({ token, - desiredProperties: { - guild: { - id: true, - joinedAt: true, - ownerId: true, - }, - }, - intents: Intents.Guilds, - events: { - async guildCreate(guild) { - if (guild.joinedAt && Date.now() - guild.joinedAt < 360000) { - return - } - - if (bot.rest.applicationId === guild.ownerId) { - logger.debug(`Deleting one of the bot created guilds. ${guild.id}`) - await bot.rest.deleteGuild(guild.id) - } - }, - }, }) await bot.start() diff --git a/packages/rest/src/manager.ts b/packages/rest/src/manager.ts index 87b63da0a..50d34ee3e 100644 --- a/packages/rest/src/manager.ts +++ b/packages/rest/src/manager.ts @@ -815,10 +815,6 @@ export function createRestManager(options: CreateRestManagerOptions): RestManage await rest.delete(rest.routes.interactions.commands.command(rest.applicationId, commandId)) }, - async deleteGuild(guildId) { - await rest.delete(rest.routes.guilds.guild(guildId)) - }, - async deleteGuildApplicationCommand(commandId, guildId) { await rest.delete(rest.routes.interactions.commands.guilds.one(rest.applicationId, guildId, commandId)) }, diff --git a/packages/rest/src/types.ts b/packages/rest/src/types.ts index 7dae2be2b..6f1407b1c 100644 --- a/packages/rest/src/types.ts +++ b/packages/rest/src/types.ts @@ -715,19 +715,6 @@ export interface RestManager { * @see {@link https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command} */ deleteGlobalApplicationCommand: (commandId: BigString) => Promise - /** - * Deletes a guild. - * - * @param guildId - The ID of the guild to delete. - * - * @remarks - * The bot user must be the owner of the guild. - * - * Fires a _Guild Delete_ gateway event. - * - * @see {@link https://discord.com/developers/docs/resources/guild#delete-guild} - */ - deleteGuild: (guildId: BigString) => Promise /** * Deletes an application command registered in a guild. * diff --git a/packages/types/src/discordeno.ts b/packages/types/src/discordeno.ts index d138daa48..ebbb17966 100644 --- a/packages/types/src/discordeno.ts +++ b/packages/types/src/discordeno.ts @@ -1549,8 +1549,6 @@ export interface ModifyGuild { afkTimeout?: number /** Base64 1024x1024 png/jpeg/gif image for the guild icon (can be animated gif when the server has the `ANIMATED_ICON` feature) */ icon?: string | null - /** User id to transfer guild ownership to (must be owner) */ - ownerId?: BigString /** Base64 16:9 png/jpeg image for the guild splash (when the server has `INVITE_SPLASH` feature) */ splash?: string | null /** Base64 16:9 png/jpeg image for the guild discovery spash (when the server has the `DISCOVERABLE` feature) */