mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
api-docs!: Remove deleteGuild & EditGuild.ownerId (#4269)
* Remove deleteGuild & EditGuild.ownerId * Change E2E test
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user