mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix(Guild)!: Remove setting owner (#11068)
BREAKING CHANGE: Setting the owner of a guild is removed.
This commit is contained in:
@@ -895,7 +895,6 @@ class Guild extends AnonymousGuild {
|
|||||||
* @property {?VoiceChannelResolvable} [afkChannel] The AFK channel of the guild
|
* @property {?VoiceChannelResolvable} [afkChannel] The AFK channel of the guild
|
||||||
* @property {number} [afkTimeout] The AFK timeout of the guild
|
* @property {number} [afkTimeout] The AFK timeout of the guild
|
||||||
* @property {?(BufferResolvable|Base64Resolvable)} [icon] The icon of the guild
|
* @property {?(BufferResolvable|Base64Resolvable)} [icon] The icon of the guild
|
||||||
* @property {UserResolvable} [owner] The owner of the guild
|
|
||||||
* @property {?(BufferResolvable|Base64Resolvable)} [splash] The invite splash image of the guild
|
* @property {?(BufferResolvable|Base64Resolvable)} [splash] The invite splash image of the guild
|
||||||
* @property {?(BufferResolvable|Base64Resolvable)} [discoverySplash] The discovery splash image of the guild
|
* @property {?(BufferResolvable|Base64Resolvable)} [discoverySplash] The discovery splash image of the guild
|
||||||
* @property {?(BufferResolvable|Base64Resolvable)} [banner] The banner of the guild
|
* @property {?(BufferResolvable|Base64Resolvable)} [banner] The banner of the guild
|
||||||
@@ -947,7 +946,6 @@ class Guild extends AnonymousGuild {
|
|||||||
afkChannel,
|
afkChannel,
|
||||||
afkTimeout,
|
afkTimeout,
|
||||||
icon,
|
icon,
|
||||||
owner,
|
|
||||||
splash,
|
splash,
|
||||||
discoverySplash,
|
discoverySplash,
|
||||||
banner,
|
banner,
|
||||||
@@ -969,7 +967,6 @@ class Guild extends AnonymousGuild {
|
|||||||
afk_channel_id: afkChannel && this.client.channels.resolveId(afkChannel),
|
afk_channel_id: afkChannel && this.client.channels.resolveId(afkChannel),
|
||||||
afk_timeout: afkTimeout,
|
afk_timeout: afkTimeout,
|
||||||
icon: icon && (await resolveImage(icon)),
|
icon: icon && (await resolveImage(icon)),
|
||||||
owner_id: owner && this.client.users.resolveId(owner),
|
|
||||||
splash: splash && (await resolveImage(splash)),
|
splash: splash && (await resolveImage(splash)),
|
||||||
discovery_splash: discoverySplash && (await resolveImage(discoverySplash)),
|
discovery_splash: discoverySplash && (await resolveImage(discoverySplash)),
|
||||||
banner: banner && (await resolveImage(banner)),
|
banner: banner && (await resolveImage(banner)),
|
||||||
@@ -1277,23 +1274,6 @@ class Guild extends AnonymousGuild {
|
|||||||
return this.edit({ icon, reason });
|
return this.edit({ icon, reason });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets a new owner of the guild.
|
|
||||||
*
|
|
||||||
* @param {UserResolvable} owner The new owner of the guild
|
|
||||||
* @param {string} [reason] Reason for setting the new owner
|
|
||||||
* @returns {Promise<Guild>}
|
|
||||||
* @example
|
|
||||||
* // Edit the guild owner
|
|
||||||
* guild.setOwner(guild.members.cache.first())
|
|
||||||
* .then(guild => guild.fetchOwner())
|
|
||||||
* .then(owner => console.log(`Updated the guild owner to ${owner.displayName}`))
|
|
||||||
* .catch(console.error);
|
|
||||||
*/
|
|
||||||
async setOwner(owner, reason) {
|
|
||||||
return this.edit({ owner, reason });
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a new guild invite splash image.
|
* Sets a new guild invite splash image.
|
||||||
*
|
*
|
||||||
|
|||||||
2
packages/discord.js/typings/index.d.ts
vendored
2
packages/discord.js/typings/index.d.ts
vendored
@@ -1477,7 +1477,6 @@ export class Guild extends AnonymousGuild {
|
|||||||
): Promise<Guild>;
|
): Promise<Guild>;
|
||||||
public setIcon(icon: Base64Resolvable | BufferResolvable | null, reason?: string): Promise<Guild>;
|
public setIcon(icon: Base64Resolvable | BufferResolvable | null, reason?: string): Promise<Guild>;
|
||||||
public setName(name: string, reason?: string): Promise<Guild>;
|
public setName(name: string, reason?: string): Promise<Guild>;
|
||||||
public setOwner(owner: UserResolvable, reason?: string): Promise<Guild>;
|
|
||||||
public setPreferredLocale(preferredLocale: Locale | null, reason?: string): Promise<Guild>;
|
public setPreferredLocale(preferredLocale: Locale | null, reason?: string): Promise<Guild>;
|
||||||
public setPublicUpdatesChannel(publicUpdatesChannel: TextChannelResolvable | null, reason?: string): Promise<Guild>;
|
public setPublicUpdatesChannel(publicUpdatesChannel: TextChannelResolvable | null, reason?: string): Promise<Guild>;
|
||||||
public setRulesChannel(rulesChannel: TextChannelResolvable | null, reason?: string): Promise<Guild>;
|
public setRulesChannel(rulesChannel: TextChannelResolvable | null, reason?: string): Promise<Guild>;
|
||||||
@@ -6123,7 +6122,6 @@ export interface GuildEditOptions {
|
|||||||
features?: readonly `${GuildFeature}`[];
|
features?: readonly `${GuildFeature}`[];
|
||||||
icon?: Base64Resolvable | BufferResolvable | null;
|
icon?: Base64Resolvable | BufferResolvable | null;
|
||||||
name?: string;
|
name?: string;
|
||||||
owner?: UserResolvable;
|
|
||||||
preferredLocale?: Locale | null;
|
preferredLocale?: Locale | null;
|
||||||
premiumProgressBarEnabled?: boolean;
|
premiumProgressBarEnabled?: boolean;
|
||||||
publicUpdatesChannel?: TextChannelResolvable | null;
|
publicUpdatesChannel?: TextChannelResolvable | null;
|
||||||
|
|||||||
Reference in New Issue
Block a user