mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 19:28:17 +00:00
This commit is contained in:
@@ -1,21 +0,0 @@
|
|||||||
import { rest } from "../../rest/rest.ts";
|
|
||||||
import { ModifyGuildIntegration } from "../../types/mod.ts";
|
|
||||||
import { endpoints } from "../../util/constants.ts";
|
|
||||||
import { requireBotGuildPermissions } from "../../util/permissions.ts";
|
|
||||||
|
|
||||||
/** Modify the behavior and settings of an integration object for the guild. Requires the MANAGE_GUILD permission. */
|
|
||||||
export async function editIntegration(
|
|
||||||
guildId: string,
|
|
||||||
id: string,
|
|
||||||
options: ModifyGuildIntegration,
|
|
||||||
) {
|
|
||||||
await requireBotGuildPermissions(guildId, ["MANAGE_GUILD"]);
|
|
||||||
|
|
||||||
const result = await rest.runMethod(
|
|
||||||
"patch",
|
|
||||||
endpoints.GUILD_INTEGRATION(guildId, id),
|
|
||||||
options,
|
|
||||||
);
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
import { rest } from "../../rest/rest.ts";
|
|
||||||
import { endpoints } from "../../util/constants.ts";
|
|
||||||
import { requireBotGuildPermissions } from "../../util/permissions.ts";
|
|
||||||
|
|
||||||
/** Sync an integration. Requires the MANAGE_GUILD permission. */
|
|
||||||
export async function syncIntegration(guildId: string, id: string) {
|
|
||||||
await requireBotGuildPermissions(guildId, ["MANAGE_GUILD"]);
|
|
||||||
|
|
||||||
const result = await rest.runMethod(
|
|
||||||
"post",
|
|
||||||
endpoints.GUILD_INTEGRATION_SYNC(guildId, id),
|
|
||||||
);
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
export interface CreateGuildIntegration {
|
|
||||||
/** The integration type */
|
|
||||||
type: string;
|
|
||||||
/** The integration id */
|
|
||||||
id: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** https://discord.com/developers/docs/resources/guild#create-guild-integration-json-params */
|
|
||||||
export type DiscordCreateGuildIntegration = CreateGuildIntegration;
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
import { SnakeCasedPropertiesDeep } from "../util.ts";
|
|
||||||
|
|
||||||
export interface ModifyGuildIntegration {
|
|
||||||
/** The behavior when an integration subscription lapses (see the [integration expire behaviors](https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors) documentation) */
|
|
||||||
expireBehavior?: number | null;
|
|
||||||
/** Period (in days) where the integration will ignore lapsed subscriptions */
|
|
||||||
expireGracePeriod?: number | null;
|
|
||||||
/** Whether emoticons should be synced for this integration (twitch only currently) */
|
|
||||||
enableEmoticonns?: boolean | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** https://discord.com/developers/docs/resources/guild#modify-guild-integration-json-params */
|
|
||||||
export type DiscordModifyGuildIntegration = SnakeCasedPropertiesDeep<
|
|
||||||
ModifyGuildIntegration
|
|
||||||
>;
|
|
||||||
Reference in New Issue
Block a user