mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
docs: Deprecate API related to guild ownership (#11054)
* docs: deprecate API usage for guild ownership * docs: remove pointless example
This commit is contained in:
@@ -163,6 +163,7 @@ class GuildManager extends CachedManager {
|
||||
* Creates a guild.
|
||||
* <warn>This is only available to bots in fewer than 10 guilds.</warn>
|
||||
* @param {GuildCreateOptions} options Options for creating the guild
|
||||
* @deprecated API related to guild ownership may no longer be used.
|
||||
* @returns {Promise<Guild>} The guild that was created
|
||||
*/
|
||||
async create({
|
||||
|
||||
@@ -1340,11 +1340,7 @@ class Guild extends AnonymousGuild {
|
||||
* @param {GuildMFALevel} level The MFA level
|
||||
* @param {string} [reason] Reason for changing the guild's MFA level
|
||||
* @returns {Promise<Guild>}
|
||||
* @example
|
||||
* // Set the MFA level of the guild to Elevated
|
||||
* guild.setMFALevel(GuildMFALevel.Elevated)
|
||||
* .then(guild => console.log("Set guild's MFA level to Elevated"))
|
||||
* .catch(console.error);
|
||||
* @deprecated API related to guild ownership may no longer be used.
|
||||
*/
|
||||
async setMFALevel(level, reason) {
|
||||
await this.client.rest.post(Routes.guildMFA(this.id), {
|
||||
@@ -1374,6 +1370,7 @@ class Guild extends AnonymousGuild {
|
||||
/**
|
||||
* Deletes the guild.
|
||||
* @returns {Promise<Guild>}
|
||||
* @deprecated API related to guild ownership may no longer be used.
|
||||
* @example
|
||||
* // Delete a guild
|
||||
* guild.delete()
|
||||
|
||||
@@ -120,6 +120,7 @@ class GuildTemplate extends Base {
|
||||
* @param {string} name The name of the guild
|
||||
* @param {BufferResolvable|Base64Resolvable} [icon] The icon for the guild
|
||||
* @returns {Promise<Guild>}
|
||||
* @deprecated API related to guild ownership may no longer be used.
|
||||
*/
|
||||
async createGuild(name, icon) {
|
||||
const { client } = this;
|
||||
|
||||
7
packages/discord.js/typings/index.d.ts
vendored
7
packages/discord.js/typings/index.d.ts
vendored
@@ -1683,6 +1683,7 @@ export class Guild extends AnonymousGuild {
|
||||
public setVerificationLevel(verificationLevel: GuildVerificationLevel | null, reason?: string): Promise<Guild>;
|
||||
public setPremiumProgressBarEnabled(enabled?: boolean, reason?: string): Promise<Guild>;
|
||||
public setWidgetSettings(settings: GuildWidgetSettingsData, reason?: string): Promise<Guild>;
|
||||
/** @deprecated API related to guild ownership may no longer be used. */
|
||||
public setMFALevel(level: GuildMFALevel, reason?: string): Promise<Guild>;
|
||||
public toJSON(): unknown;
|
||||
}
|
||||
@@ -2021,6 +2022,7 @@ export class GuildTemplate extends Base {
|
||||
public guildId: Snowflake;
|
||||
public serializedGuild: APITemplateSerializedSourceGuild;
|
||||
public unSynced: boolean | null;
|
||||
/** @deprecated API related to guild ownership may no longer be used. */
|
||||
public createGuild(name: string, icon?: BufferResolvable | Base64Resolvable): Promise<Guild>;
|
||||
public delete(): Promise<GuildTemplate>;
|
||||
public edit(options?: GuildTemplateEditOptions): Promise<GuildTemplate>;
|
||||
@@ -4846,6 +4848,7 @@ export interface FetchSoundboardSoundsOptions {
|
||||
|
||||
export class GuildManager extends CachedManager<Snowflake, Guild, GuildResolvable> {
|
||||
private constructor(client: Client<true>, iterable?: Iterable<RawGuildData>);
|
||||
/** @deprecated API related to guild ownership may no longer be used. */
|
||||
public create(options: GuildCreateOptions): Promise<Guild>;
|
||||
public fetch(options: Snowflake | FetchGuildOptions): Promise<Guild>;
|
||||
public fetch(options?: FetchGuildsOptions): Promise<Collection<Snowflake, OAuth2Guild>>;
|
||||
@@ -6646,6 +6649,7 @@ export interface GuildChannelOverwriteOptions {
|
||||
type?: OverwriteType;
|
||||
}
|
||||
|
||||
/** @deprecated API related to guild ownership may no longer be used. */
|
||||
export interface GuildCreateOptions {
|
||||
name: string;
|
||||
icon?: BufferResolvable | Base64Resolvable | null;
|
||||
@@ -7321,6 +7325,7 @@ export interface PresenceData {
|
||||
|
||||
export type PresenceResolvable = Presence | UserResolvable | Snowflake;
|
||||
|
||||
/** @deprecated API related to guild ownership may no longer be used. */
|
||||
export interface PartialChannelData {
|
||||
id?: Snowflake | number;
|
||||
parentId?: Snowflake | number;
|
||||
@@ -7379,6 +7384,7 @@ export interface PartialThreadMember extends Partialize<ThreadMember, 'flags' |
|
||||
|
||||
export interface PartialSoundboardSound extends Partialize<SoundboardSound, 'available' | 'name' | 'volume'> {}
|
||||
|
||||
/** @deprecated API related to guild ownership may no longer be used. */
|
||||
export interface PartialOverwriteData {
|
||||
id: Snowflake | number;
|
||||
type?: OverwriteType;
|
||||
@@ -7386,6 +7392,7 @@ export interface PartialOverwriteData {
|
||||
deny?: PermissionResolvable;
|
||||
}
|
||||
|
||||
/** @deprecated API related to guild ownership may no longer be used. */
|
||||
export interface PartialRoleData extends RoleData {
|
||||
id?: Snowflake | number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user