mirror of
https://github.com/discordeno/discordeno.git
synced 2026-05-31 07:50:07 +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()
|
||||
|
||||
@@ -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))
|
||||
},
|
||||
|
||||
@@ -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<void>
|
||||
/**
|
||||
* 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<void>
|
||||
/**
|
||||
* Deletes an application command registered in a guild.
|
||||
*
|
||||
|
||||
@@ -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) */
|
||||
|
||||
Reference in New Issue
Block a user