This commit is contained in:
ayntee
2021-04-12 23:12:26 +04:00
parent 3153487b51
commit e16d7a09e8
3 changed files with 7 additions and 5 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
import { rest } from "../../rest/rest.ts";
import { ModifyGuildIntegration } from "../../types/mod.ts";
import { endpoints } from "../../util/constants.ts";
import { requireBotGuildPermissions } from "../../util/permissions.ts";
@@ -6,7 +7,7 @@ import { requireBotGuildPermissions } from "../../util/permissions.ts";
export async function editIntegration(
guildId: string,
id: string,
options: EditIntegrationOptions,
options: ModifyGuildIntegration,
) {
await requireBotGuildPermissions(guildId, ["MANAGE_GUILD"]);
+3 -3
View File
@@ -11,7 +11,7 @@ export async function getMessages(
| GetMessagesAfter
| GetMessagesBefore
| GetMessagesAround
| GetMessages
| GetMessages,
) {
await requireBotChannelPermissions(channelId, [
"VIEW_CHANNEL",
@@ -23,10 +23,10 @@ export async function getMessages(
const result = (await rest.runMethod(
"get",
endpoints.CHANNEL_MESSAGES(channelId),
options
options,
)) as DiscordMessage[];
return Promise.all(
result.map((res) => structures.createDiscordenoMessage(res))
result.map((res) => structures.createDiscordenoMessage(res)),
);
}
+2 -1
View File
@@ -7,6 +7,7 @@ import { CreateGlobalApplicationCommand } from "../types/interactions/create_glo
import { Errors } from "../types/misc/errors.ts";
import { DiscordImageFormat } from "../types/misc/image_format.ts";
import { DiscordImageSize } from "../types/misc/image_size.ts";
import { EditGlobalApplicationCommand } from "../types/mod.ts";
import { SLASH_COMMANDS_NAME_REGEX } from "./constants.ts";
export async function urlToBase64(url: string) {
@@ -167,7 +168,7 @@ function validateSlashOptions(options: ApplicationCommandOption[]) {
}
export function validateSlashCommands(
commands: CreateGlobalApplicationCommand[],
commands: (CreateGlobalApplicationCommand | EditGlobalApplicationCommand)[],
create = false,
) {
for (const command of commands) {