api-docs!: Remove deleteGuild & EditGuild.ownerId (#4269)

* Remove deleteGuild & EditGuild.ownerId

* Change E2E test
This commit is contained in:
Fleny
2025-07-31 21:05:31 +02:00
committed by GitHub
parent f4098d573f
commit 068ecf897b
5 changed files with 3 additions and 47 deletions
-4
View File
@@ -671,9 +671,6 @@ export function createBotHelpers<TProps extends TransformersDesiredProperties, T
deleteGlobalApplicationCommand: async (commandId) => {
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<TProps extends TransformersDesiredProperties, TBehavior e
deleteApplicationEmoji: (id: BigString) => Promise<void>
deleteFollowupMessage: (token: string, messageId: BigString) => Promise<void>
deleteGlobalApplicationCommand: (commandId: BigString) => Promise<void>
deleteGuild: (guildId: BigString) => Promise<void>
deleteGuildApplicationCommand: (commandId: BigString, guildId: BigString) => Promise<void>
deleteGuildSticker: (guildId: BigString, stickerId: BigString, reason?: string) => Promise<void>
deleteGuildTemplate: (guildId: BigString, templateCode: string) => Promise<void>
+3 -24
View File
@@ -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()