mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 19:28:17 +00:00
Moar
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import { rest } from "../../rest/rest.ts";
|
import { rest } from "../../rest/rest.ts";
|
||||||
|
import { ModifyGuildIntegration } from "../../types/mod.ts";
|
||||||
import { endpoints } from "../../util/constants.ts";
|
import { endpoints } from "../../util/constants.ts";
|
||||||
import { requireBotGuildPermissions } from "../../util/permissions.ts";
|
import { requireBotGuildPermissions } from "../../util/permissions.ts";
|
||||||
|
|
||||||
@@ -6,7 +7,7 @@ import { requireBotGuildPermissions } from "../../util/permissions.ts";
|
|||||||
export async function editIntegration(
|
export async function editIntegration(
|
||||||
guildId: string,
|
guildId: string,
|
||||||
id: string,
|
id: string,
|
||||||
options: EditIntegrationOptions,
|
options: ModifyGuildIntegration,
|
||||||
) {
|
) {
|
||||||
await requireBotGuildPermissions(guildId, ["MANAGE_GUILD"]);
|
await requireBotGuildPermissions(guildId, ["MANAGE_GUILD"]);
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export async function getMessages(
|
|||||||
| GetMessagesAfter
|
| GetMessagesAfter
|
||||||
| GetMessagesBefore
|
| GetMessagesBefore
|
||||||
| GetMessagesAround
|
| GetMessagesAround
|
||||||
| GetMessages
|
| GetMessages,
|
||||||
) {
|
) {
|
||||||
await requireBotChannelPermissions(channelId, [
|
await requireBotChannelPermissions(channelId, [
|
||||||
"VIEW_CHANNEL",
|
"VIEW_CHANNEL",
|
||||||
@@ -23,10 +23,10 @@ export async function getMessages(
|
|||||||
const result = (await rest.runMethod(
|
const result = (await rest.runMethod(
|
||||||
"get",
|
"get",
|
||||||
endpoints.CHANNEL_MESSAGES(channelId),
|
endpoints.CHANNEL_MESSAGES(channelId),
|
||||||
options
|
options,
|
||||||
)) as DiscordMessage[];
|
)) as DiscordMessage[];
|
||||||
|
|
||||||
return Promise.all(
|
return Promise.all(
|
||||||
result.map((res) => structures.createDiscordenoMessage(res))
|
result.map((res) => structures.createDiscordenoMessage(res)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -7,6 +7,7 @@ import { CreateGlobalApplicationCommand } from "../types/interactions/create_glo
|
|||||||
import { Errors } from "../types/misc/errors.ts";
|
import { Errors } from "../types/misc/errors.ts";
|
||||||
import { DiscordImageFormat } from "../types/misc/image_format.ts";
|
import { DiscordImageFormat } from "../types/misc/image_format.ts";
|
||||||
import { DiscordImageSize } from "../types/misc/image_size.ts";
|
import { DiscordImageSize } from "../types/misc/image_size.ts";
|
||||||
|
import { EditGlobalApplicationCommand } from "../types/mod.ts";
|
||||||
import { SLASH_COMMANDS_NAME_REGEX } from "./constants.ts";
|
import { SLASH_COMMANDS_NAME_REGEX } from "./constants.ts";
|
||||||
|
|
||||||
export async function urlToBase64(url: string) {
|
export async function urlToBase64(url: string) {
|
||||||
@@ -167,7 +168,7 @@ function validateSlashOptions(options: ApplicationCommandOption[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function validateSlashCommands(
|
export function validateSlashCommands(
|
||||||
commands: CreateGlobalApplicationCommand[],
|
commands: (CreateGlobalApplicationCommand | EditGlobalApplicationCommand)[],
|
||||||
create = false,
|
create = false,
|
||||||
) {
|
) {
|
||||||
for (const command of commands) {
|
for (const command of commands) {
|
||||||
|
|||||||
Reference in New Issue
Block a user