mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 20:13:30 +01:00
chore(Integration): Cleanup removed methods (#6220)
This commit is contained in:
@@ -574,26 +574,6 @@ class Guild extends AnonymousGuild {
|
|||||||
return new WelcomeScreen(this, data);
|
return new WelcomeScreen(this, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The data for creating an integration.
|
|
||||||
* @typedef {Object} IntegrationData
|
|
||||||
* @property {string} id The integration id
|
|
||||||
* @property {string} type The integration type
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates an integration by attaching an integration object
|
|
||||||
* @param {IntegrationData} data The data for the integration
|
|
||||||
* @param {string} reason Reason for creating the integration
|
|
||||||
* @returns {Promise<Guild>}
|
|
||||||
*/
|
|
||||||
createIntegration(data, reason) {
|
|
||||||
return this.client.api
|
|
||||||
.guilds(this.id)
|
|
||||||
.integrations.post({ data, reason })
|
|
||||||
.then(() => this);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a template for the guild.
|
* Creates a template for the guild.
|
||||||
* @param {string} name The name for the template
|
* @param {string} name The name for the template
|
||||||
|
|||||||
@@ -121,56 +121,6 @@ class Integration extends Base {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sync this integration
|
|
||||||
* @returns {Promise<Integration>}
|
|
||||||
*/
|
|
||||||
sync() {
|
|
||||||
this.syncing = true;
|
|
||||||
return this.client.api
|
|
||||||
.guilds(this.guild.id)
|
|
||||||
.integrations(this.id)
|
|
||||||
.post()
|
|
||||||
.then(() => {
|
|
||||||
this.syncing = false;
|
|
||||||
this.syncedAt = Date.now();
|
|
||||||
return this;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The data for editing an integration.
|
|
||||||
* @typedef {Object} IntegrationEditData
|
|
||||||
* @property {number} [expireBehavior] The new behaviour of expiring subscribers
|
|
||||||
* @property {number} [expireGracePeriod] The new grace period before expiring subscribers
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Edits this integration.
|
|
||||||
* @param {IntegrationEditData} data The data to edit this integration with
|
|
||||||
* @param {string} reason Reason for editing this integration
|
|
||||||
* @returns {Promise<Integration>}
|
|
||||||
*/
|
|
||||||
edit(data, reason) {
|
|
||||||
if ('expireBehavior' in data) {
|
|
||||||
data.expire_behavior = data.expireBehavior;
|
|
||||||
data.expireBehavior = null;
|
|
||||||
}
|
|
||||||
if ('expireGracePeriod' in data) {
|
|
||||||
data.expire_grace_period = data.expireGracePeriod;
|
|
||||||
data.expireGracePeriod = null;
|
|
||||||
}
|
|
||||||
// The option enable_emoticons is only available for Twitch at this moment
|
|
||||||
return this.client.api
|
|
||||||
.guilds(this.guild.id)
|
|
||||||
.integrations(this.id)
|
|
||||||
.patch({ data, reason })
|
|
||||||
.then(() => {
|
|
||||||
this._patch(data);
|
|
||||||
return this;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes this integration.
|
* Deletes this integration.
|
||||||
* @returns {Promise<Integration>}
|
* @returns {Promise<Integration>}
|
||||||
|
|||||||
13
typings/index.d.ts
vendored
13
typings/index.d.ts
vendored
@@ -576,7 +576,6 @@ export class Guild extends AnonymousGuild {
|
|||||||
public widgetChannelId: Snowflake | null;
|
public widgetChannelId: Snowflake | null;
|
||||||
public widgetEnabled: boolean | null;
|
public widgetEnabled: boolean | null;
|
||||||
public addMember(user: UserResolvable, options: AddGuildMemberOptions): Promise<GuildMember>;
|
public addMember(user: UserResolvable, options: AddGuildMemberOptions): Promise<GuildMember>;
|
||||||
public createIntegration(data: IntegrationData, reason?: string): Promise<Guild>;
|
|
||||||
public createTemplate(name: string, description?: string): Promise<GuildTemplate>;
|
public createTemplate(name: string, description?: string): Promise<GuildTemplate>;
|
||||||
public delete(): Promise<Guild>;
|
public delete(): Promise<Guild>;
|
||||||
public discoverySplashURL(options?: StaticImageURLOptions): string | null;
|
public discoverySplashURL(options?: StaticImageURLOptions): string | null;
|
||||||
@@ -849,8 +848,6 @@ export class Integration extends Base {
|
|||||||
public type: string;
|
public type: string;
|
||||||
public user: User | null;
|
public user: User | null;
|
||||||
public delete(reason?: string): Promise<Integration>;
|
public delete(reason?: string): Promise<Integration>;
|
||||||
public edit(data: IntegrationEditData, reason?: string): Promise<Integration>;
|
|
||||||
public sync(): Promise<Integration>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class IntegrationApplication extends Application {
|
export class IntegrationApplication extends Application {
|
||||||
@@ -3671,16 +3668,6 @@ export interface ImageURLOptions extends StaticImageURLOptions {
|
|||||||
dynamic?: boolean;
|
dynamic?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IntegrationData {
|
|
||||||
id: Snowflake;
|
|
||||||
type: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IntegrationEditData {
|
|
||||||
expireBehavior?: number;
|
|
||||||
expireGracePeriod?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IntegrationAccount {
|
export interface IntegrationAccount {
|
||||||
id: string | Snowflake;
|
id: string | Snowflake;
|
||||||
name: string;
|
name: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user