mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
api-docs!: Remove createGuild and createGuildFromTemplate (#4268)
This commit is contained in:
@@ -15,13 +15,11 @@ import type {
|
|||||||
CreateEntitlement,
|
CreateEntitlement,
|
||||||
CreateForumPostWithMessage,
|
CreateForumPostWithMessage,
|
||||||
CreateGlobalApplicationCommandOptions,
|
CreateGlobalApplicationCommandOptions,
|
||||||
CreateGuild,
|
|
||||||
CreateGuildApplicationCommandOptions,
|
CreateGuildApplicationCommandOptions,
|
||||||
CreateGuildBan,
|
CreateGuildBan,
|
||||||
CreateGuildBulkBan,
|
CreateGuildBulkBan,
|
||||||
CreateGuildChannel,
|
CreateGuildChannel,
|
||||||
CreateGuildEmoji,
|
CreateGuildEmoji,
|
||||||
CreateGuildFromTemplate,
|
|
||||||
CreateGuildRole,
|
CreateGuildRole,
|
||||||
CreateGuildSoundboardSound,
|
CreateGuildSoundboardSound,
|
||||||
CreateGuildStickerOptions,
|
CreateGuildStickerOptions,
|
||||||
@@ -171,15 +169,9 @@ export function createBotHelpers<TProps extends TransformersDesiredProperties, T
|
|||||||
createGlobalApplicationCommand: async (command, options) => {
|
createGlobalApplicationCommand: async (command, options) => {
|
||||||
return bot.transformers.applicationCommand(bot, snakelize(await bot.rest.createGlobalApplicationCommand(command, options)))
|
return bot.transformers.applicationCommand(bot, snakelize(await bot.rest.createGlobalApplicationCommand(command, options)))
|
||||||
},
|
},
|
||||||
createGuild: async (options) => {
|
|
||||||
return bot.transformers.guild(bot, { guild: snakelize(await bot.rest.createGuild(options)), shardId: 0 })
|
|
||||||
},
|
|
||||||
createGuildApplicationCommand: async (command, guildId, options) => {
|
createGuildApplicationCommand: async (command, guildId, options) => {
|
||||||
return bot.transformers.applicationCommand(bot, snakelize(await bot.rest.createGuildApplicationCommand(command, guildId, options)))
|
return bot.transformers.applicationCommand(bot, snakelize(await bot.rest.createGuildApplicationCommand(command, guildId, options)))
|
||||||
},
|
},
|
||||||
createGuildFromTemplate: async (templateCode, options) => {
|
|
||||||
return bot.transformers.guild(bot, { guild: snakelize(await bot.rest.createGuildFromTemplate(templateCode, options)), shardId: 0 })
|
|
||||||
},
|
|
||||||
createGuildSticker: async (guildId, options, reason) => {
|
createGuildSticker: async (guildId, options, reason) => {
|
||||||
return bot.transformers.sticker(bot, snakelize(await bot.rest.createGuildSticker(guildId, options, reason)))
|
return bot.transformers.sticker(bot, snakelize(await bot.rest.createGuildSticker(guildId, options, reason)))
|
||||||
},
|
},
|
||||||
@@ -877,15 +869,11 @@ export type BotHelpers<TProps extends TransformersDesiredProperties, TBehavior e
|
|||||||
reason?: string,
|
reason?: string,
|
||||||
) => Promise<SetupDesiredProps<Channel, TProps, TBehavior>>
|
) => Promise<SetupDesiredProps<Channel, TProps, TBehavior>>
|
||||||
createGlobalApplicationCommand: (command: CreateApplicationCommand, options?: CreateGlobalApplicationCommandOptions) => Promise<ApplicationCommand>
|
createGlobalApplicationCommand: (command: CreateApplicationCommand, options?: CreateGlobalApplicationCommandOptions) => Promise<ApplicationCommand>
|
||||||
/** @deprecated */
|
|
||||||
createGuild: (options: CreateGuild) => Promise<SetupDesiredProps<Guild, TProps, TBehavior>>
|
|
||||||
createGuildApplicationCommand: (
|
createGuildApplicationCommand: (
|
||||||
command: CreateApplicationCommand,
|
command: CreateApplicationCommand,
|
||||||
guildId: BigString,
|
guildId: BigString,
|
||||||
options?: CreateGuildApplicationCommandOptions,
|
options?: CreateGuildApplicationCommandOptions,
|
||||||
) => Promise<ApplicationCommand>
|
) => Promise<ApplicationCommand>
|
||||||
/** @deprecated */
|
|
||||||
createGuildFromTemplate: (templateCode: string, options: CreateGuildFromTemplate) => Promise<SetupDesiredProps<Guild, TProps, TBehavior>>
|
|
||||||
createGuildSticker: (
|
createGuildSticker: (
|
||||||
guildId: BigString,
|
guildId: BigString,
|
||||||
options: CreateGuildStickerOptions,
|
options: CreateGuildStickerOptions,
|
||||||
|
|||||||
@@ -729,10 +729,6 @@ export function createRestManager(options: CreateRestManagerOptions): RestManage
|
|||||||
return await rest.post<DiscordApplicationCommand>(rest.routes.interactions.commands.commands(rest.applicationId), restOptions)
|
return await rest.post<DiscordApplicationCommand>(rest.routes.interactions.commands.commands(rest.applicationId), restOptions)
|
||||||
},
|
},
|
||||||
|
|
||||||
async createGuild(body) {
|
|
||||||
return await rest.post<DiscordGuild>(rest.routes.guilds.all(), { body })
|
|
||||||
},
|
|
||||||
|
|
||||||
async createGuildApplicationCommand(body, guildId, options) {
|
async createGuildApplicationCommand(body, guildId, options) {
|
||||||
const restOptions: MakeRequestOptions = { body }
|
const restOptions: MakeRequestOptions = { body }
|
||||||
|
|
||||||
@@ -746,14 +742,6 @@ export function createRestManager(options: CreateRestManagerOptions): RestManage
|
|||||||
return await rest.post<DiscordApplicationCommand>(rest.routes.interactions.commands.guilds.all(rest.applicationId, guildId), restOptions)
|
return await rest.post<DiscordApplicationCommand>(rest.routes.interactions.commands.guilds.all(rest.applicationId, guildId), restOptions)
|
||||||
},
|
},
|
||||||
|
|
||||||
async createGuildFromTemplate(templateCode, body) {
|
|
||||||
if (body.icon) {
|
|
||||||
body.icon = await urlToBase64(body.icon)
|
|
||||||
}
|
|
||||||
|
|
||||||
return await rest.post<DiscordGuild>(rest.routes.guilds.templates.code(templateCode), { body })
|
|
||||||
},
|
|
||||||
|
|
||||||
async createGuildSticker(guildId, options, reason) {
|
async createGuildSticker(guildId, options, reason) {
|
||||||
const form = new FormData()
|
const form = new FormData()
|
||||||
form.append('file', options.file.blob, options.file.name)
|
form.append('file', options.file.blob, options.file.name)
|
||||||
|
|||||||
@@ -13,13 +13,11 @@ import type {
|
|||||||
CreateEntitlement,
|
CreateEntitlement,
|
||||||
CreateForumPostWithMessage,
|
CreateForumPostWithMessage,
|
||||||
CreateGlobalApplicationCommandOptions,
|
CreateGlobalApplicationCommandOptions,
|
||||||
CreateGuild,
|
|
||||||
CreateGuildApplicationCommandOptions,
|
CreateGuildApplicationCommandOptions,
|
||||||
CreateGuildBan,
|
CreateGuildBan,
|
||||||
CreateGuildBulkBan,
|
CreateGuildBulkBan,
|
||||||
CreateGuildChannel,
|
CreateGuildChannel,
|
||||||
CreateGuildEmoji,
|
CreateGuildEmoji,
|
||||||
CreateGuildFromTemplate,
|
|
||||||
CreateGuildRole,
|
CreateGuildRole,
|
||||||
CreateGuildSoundboardSound,
|
CreateGuildSoundboardSound,
|
||||||
CreateGuildStickerOptions,
|
CreateGuildStickerOptions,
|
||||||
@@ -477,25 +475,6 @@ export interface RestManager {
|
|||||||
command: CreateApplicationCommand,
|
command: CreateApplicationCommand,
|
||||||
options?: CreateGlobalApplicationCommandOptions,
|
options?: CreateGlobalApplicationCommandOptions,
|
||||||
) => Promise<Camelize<DiscordApplicationCommand>>
|
) => Promise<Camelize<DiscordApplicationCommand>>
|
||||||
/**
|
|
||||||
* Creates a guild.
|
|
||||||
*
|
|
||||||
* @param options - The parameters for the creation of the guild.
|
|
||||||
* @returns An instance of the created {@link DiscordGuild}.
|
|
||||||
*
|
|
||||||
* @deprecated
|
|
||||||
* This endpoint is deprecated by Discord and will be disabled on July 15 2025.
|
|
||||||
*
|
|
||||||
* Check Discord announcement for details: {@link https://discord.com/developers/docs/change-log#deprecating-guild-creation-by-apps}
|
|
||||||
*
|
|
||||||
* @remarks
|
|
||||||
* ⚠️ This route can only be used by bots in __fewer than 10 guilds__.
|
|
||||||
*
|
|
||||||
* Fires a _Guild Create_ gateway event.
|
|
||||||
*
|
|
||||||
* @see {@link https://discord.com/developers/docs/resources/guild#create-guild}
|
|
||||||
*/
|
|
||||||
createGuild: (options: CreateGuild) => Promise<Camelize<DiscordGuild>>
|
|
||||||
/**
|
/**
|
||||||
* Creates an application command only accessible in a specific guild.
|
* Creates an application command only accessible in a specific guild.
|
||||||
*
|
*
|
||||||
@@ -518,27 +497,6 @@ export interface RestManager {
|
|||||||
guildId: BigString,
|
guildId: BigString,
|
||||||
options?: CreateGuildApplicationCommandOptions,
|
options?: CreateGuildApplicationCommandOptions,
|
||||||
) => Promise<Camelize<DiscordApplicationCommand>>
|
) => Promise<Camelize<DiscordApplicationCommand>>
|
||||||
/**
|
|
||||||
* Creates a guild from a template.
|
|
||||||
*
|
|
||||||
* @param templateCode - The code of the template.
|
|
||||||
* @param options - The parameters for the creation of the guild.
|
|
||||||
* @returns An instance of the created {@link DiscordGuild}.
|
|
||||||
*
|
|
||||||
* @deprecated
|
|
||||||
* This endpoint is deprecated by Discord and will be disabled on July 15 2025.
|
|
||||||
*
|
|
||||||
* Check Discord announcement for details: {@link https://discord.com/developers/docs/change-log#deprecating-guild-creation-by-apps}
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @remarks
|
|
||||||
* ⚠️ This route can only be used by bots in __fewer than 10 guilds__.
|
|
||||||
*
|
|
||||||
* Fires a _Guild Create_ gateway event.
|
|
||||||
*
|
|
||||||
* @see {@link https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template}
|
|
||||||
*/
|
|
||||||
createGuildFromTemplate: (templateCode: string, options: CreateGuildFromTemplate) => Promise<Camelize<DiscordGuild>>
|
|
||||||
/**
|
/**
|
||||||
* Create a new sticker for the guild.
|
* Create a new sticker for the guild.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import type {
|
|||||||
} from './discord/autoModeration.js'
|
} from './discord/autoModeration.js'
|
||||||
import type {
|
import type {
|
||||||
ChannelTypes,
|
ChannelTypes,
|
||||||
DiscordChannel,
|
|
||||||
DiscordDefaultReactionEmoji,
|
DiscordDefaultReactionEmoji,
|
||||||
DiscordForumTag,
|
DiscordForumTag,
|
||||||
ForumLayout,
|
ForumLayout,
|
||||||
@@ -61,7 +60,7 @@ import type {
|
|||||||
DiscordReactionType,
|
DiscordReactionType,
|
||||||
MessageFlags,
|
MessageFlags,
|
||||||
} from './discord/message.js'
|
} from './discord/message.js'
|
||||||
import type { DiscordRole, PermissionStrings } from './discord/permissions.js'
|
import type { PermissionStrings } from './discord/permissions.js'
|
||||||
import type { DiscordPollAnswer, DiscordPollLayoutType, DiscordPollMedia } from './discord/poll.js'
|
import type { DiscordPollAnswer, DiscordPollLayoutType, DiscordPollMedia } from './discord/poll.js'
|
||||||
import type { Localization } from './discord/reference.js'
|
import type { Localization } from './discord/reference.js'
|
||||||
import type { DiscordWebhookEventType } from './discord/webhookEvents.js'
|
import type { DiscordWebhookEventType } from './discord/webhookEvents.js'
|
||||||
@@ -180,7 +179,7 @@ export interface ButtonComponent extends BaseComponent {
|
|||||||
skuId?: BigString
|
skuId?: BigString
|
||||||
/**
|
/**
|
||||||
* optional url for link-style buttons that can navigate a user to the web.
|
* optional url for link-style buttons that can navigate a user to the web.
|
||||||
*
|
*
|
||||||
* @remarks
|
* @remarks
|
||||||
* Only {@link ButtonStyles.Link | Link} buttons can have a url.
|
* Only {@link ButtonStyles.Link | Link} buttons can have a url.
|
||||||
*
|
*
|
||||||
@@ -1472,32 +1471,6 @@ export interface GetApplicationCommandPermissionOptions {
|
|||||||
applicationId: BigString
|
applicationId: BigString
|
||||||
}
|
}
|
||||||
|
|
||||||
/** https://discord.com/developers/docs/resources/guild#create-guild */
|
|
||||||
export interface CreateGuild {
|
|
||||||
/** Name of the guild (1-100 characters) */
|
|
||||||
name: string
|
|
||||||
/** Base64 128x128 image for the guild icon */
|
|
||||||
icon?: string
|
|
||||||
/** Verification level */
|
|
||||||
verificationLevel?: VerificationLevels
|
|
||||||
/** Default message notification level */
|
|
||||||
defaultMessageNotifications?: DefaultMessageNotificationLevels
|
|
||||||
/** Explicit content filter level */
|
|
||||||
explicitContentFilter?: ExplicitContentFilterLevels
|
|
||||||
/** New guild roles (first role is the everyone role) */
|
|
||||||
roles?: Camelize<DiscordRole[]>
|
|
||||||
/** New guild's channels */
|
|
||||||
channels?: Partial<Camelize<DiscordChannel>>[]
|
|
||||||
/** Id for afk channel */
|
|
||||||
afkChannelId?: string
|
|
||||||
/** Afk timeout in seconds */
|
|
||||||
afkTimeout?: number
|
|
||||||
/** The id of the channel where guild notices such as welcome messages and boost events are posted */
|
|
||||||
systemChannelId?: string
|
|
||||||
/** System channel flags */
|
|
||||||
systemChannelFlags?: SystemChannelFlags
|
|
||||||
}
|
|
||||||
|
|
||||||
/** https://discord.com/developers/docs/resources/guild#create-guild-role-json-params */
|
/** https://discord.com/developers/docs/resources/guild#create-guild-role-json-params */
|
||||||
export interface CreateGuildRole {
|
export interface CreateGuildRole {
|
||||||
/** Name of the role, max 100 characters, default: "new role" */
|
/** Name of the role, max 100 characters, default: "new role" */
|
||||||
@@ -1620,14 +1593,6 @@ export interface EditGuildStickerOptions {
|
|||||||
tags?: string
|
tags?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
/** https://discord.com/developers/docs/resources/template#create-guild-from-template-json-params */
|
|
||||||
export interface CreateGuildFromTemplate {
|
|
||||||
/** Name of the guild (2-100 characters) */
|
|
||||||
name: string
|
|
||||||
/** base64 128x128 image for the guild icon */
|
|
||||||
icon?: string
|
|
||||||
}
|
|
||||||
|
|
||||||
/** https://discord.com/developers/docs/resources/guild#update-current-user-voice-state */
|
/** https://discord.com/developers/docs/resources/guild#update-current-user-voice-state */
|
||||||
export interface EditOwnVoiceState {
|
export interface EditOwnVoiceState {
|
||||||
/** The id of the channel the user is currently in */
|
/** The id of the channel the user is currently in */
|
||||||
|
|||||||
Reference in New Issue
Block a user