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;
|
||||
}
|
||||
Reference in New Issue
Block a user