mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-04 09:50:07 +00:00
api-docs!: Remove createGuild and createGuildFromTemplate (#4268)
This commit is contained in:
@@ -15,13 +15,11 @@ import type {
|
||||
CreateEntitlement,
|
||||
CreateForumPostWithMessage,
|
||||
CreateGlobalApplicationCommandOptions,
|
||||
CreateGuild,
|
||||
CreateGuildApplicationCommandOptions,
|
||||
CreateGuildBan,
|
||||
CreateGuildBulkBan,
|
||||
CreateGuildChannel,
|
||||
CreateGuildEmoji,
|
||||
CreateGuildFromTemplate,
|
||||
CreateGuildRole,
|
||||
CreateGuildSoundboardSound,
|
||||
CreateGuildStickerOptions,
|
||||
@@ -171,15 +169,9 @@ export function createBotHelpers<TProps extends TransformersDesiredProperties, T
|
||||
createGlobalApplicationCommand: async (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) => {
|
||||
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) => {
|
||||
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,
|
||||
) => Promise<SetupDesiredProps<Channel, TProps, TBehavior>>
|
||||
createGlobalApplicationCommand: (command: CreateApplicationCommand, options?: CreateGlobalApplicationCommandOptions) => Promise<ApplicationCommand>
|
||||
/** @deprecated */
|
||||
createGuild: (options: CreateGuild) => Promise<SetupDesiredProps<Guild, TProps, TBehavior>>
|
||||
createGuildApplicationCommand: (
|
||||
command: CreateApplicationCommand,
|
||||
guildId: BigString,
|
||||
options?: CreateGuildApplicationCommandOptions,
|
||||
) => Promise<ApplicationCommand>
|
||||
/** @deprecated */
|
||||
createGuildFromTemplate: (templateCode: string, options: CreateGuildFromTemplate) => Promise<SetupDesiredProps<Guild, TProps, TBehavior>>
|
||||
createGuildSticker: (
|
||||
guildId: BigString,
|
||||
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)
|
||||
},
|
||||
|
||||
async createGuild(body) {
|
||||
return await rest.post<DiscordGuild>(rest.routes.guilds.all(), { body })
|
||||
},
|
||||
|
||||
async createGuildApplicationCommand(body, guildId, options) {
|
||||
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)
|
||||
},
|
||||
|
||||
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) {
|
||||
const form = new FormData()
|
||||
form.append('file', options.file.blob, options.file.name)
|
||||
|
||||
@@ -13,13 +13,11 @@ import type {
|
||||
CreateEntitlement,
|
||||
CreateForumPostWithMessage,
|
||||
CreateGlobalApplicationCommandOptions,
|
||||
CreateGuild,
|
||||
CreateGuildApplicationCommandOptions,
|
||||
CreateGuildBan,
|
||||
CreateGuildBulkBan,
|
||||
CreateGuildChannel,
|
||||
CreateGuildEmoji,
|
||||
CreateGuildFromTemplate,
|
||||
CreateGuildRole,
|
||||
CreateGuildSoundboardSound,
|
||||
CreateGuildStickerOptions,
|
||||
@@ -477,25 +475,6 @@ export interface RestManager {
|
||||
command: CreateApplicationCommand,
|
||||
options?: CreateGlobalApplicationCommandOptions,
|
||||
) => 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.
|
||||
*
|
||||
@@ -518,27 +497,6 @@ export interface RestManager {
|
||||
guildId: BigString,
|
||||
options?: CreateGuildApplicationCommandOptions,
|
||||
) => 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.
|
||||
*
|
||||
|
||||
@@ -13,7 +13,6 @@ import type {
|
||||
} from './discord/autoModeration.js'
|
||||
import type {
|
||||
ChannelTypes,
|
||||
DiscordChannel,
|
||||
DiscordDefaultReactionEmoji,
|
||||
DiscordForumTag,
|
||||
ForumLayout,
|
||||
@@ -61,7 +60,7 @@ import type {
|
||||
DiscordReactionType,
|
||||
MessageFlags,
|
||||
} 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 { Localization } from './discord/reference.js'
|
||||
import type { DiscordWebhookEventType } from './discord/webhookEvents.js'
|
||||
@@ -180,7 +179,7 @@ export interface ButtonComponent extends BaseComponent {
|
||||
skuId?: BigString
|
||||
/**
|
||||
* optional url for link-style buttons that can navigate a user to the web.
|
||||
*
|
||||
*
|
||||
* @remarks
|
||||
* Only {@link ButtonStyles.Link | Link} buttons can have a url.
|
||||
*
|
||||
@@ -1472,32 +1471,6 @@ export interface GetApplicationCommandPermissionOptions {
|
||||
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 */
|
||||
export interface CreateGuildRole {
|
||||
/** Name of the role, max 100 characters, default: "new role" */
|
||||
@@ -1620,14 +1593,6 @@ export interface EditGuildStickerOptions {
|
||||
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 */
|
||||
export interface EditOwnVoiceState {
|
||||
/** The id of the channel the user is currently in */
|
||||
|
||||
Reference in New Issue
Block a user