mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
Merge remote-tracking branch 'origin/fp-attempt-9001' into fp-attempt-9001
This commit is contained in:
+2
-2
@@ -74,7 +74,7 @@ import {
|
||||
DiscordenoShard,
|
||||
} from "./ws/mod.ts";
|
||||
import { validateLength } from "./util/validate_length.ts";
|
||||
import {delay, validateComponents, validateSlashOptionChoices, validateSlashOptions} from "./util/utils.ts";
|
||||
import { delay, validateComponents, validateSlashOptionChoices, validateSlashOptions } from "./util/utils.ts";
|
||||
import { iconBigintToHash, iconHashToBigInt } from "./util/hash.ts";
|
||||
import { calculateShardId } from "./util/calculate_shard_id.ts";
|
||||
|
||||
@@ -284,7 +284,7 @@ export function createUtils(options: Partial<HelperUtils>) {
|
||||
validateSlashOptions,
|
||||
validateSlashOptionChoices,
|
||||
requireBotChannelPermissions,
|
||||
validateComponents
|
||||
validateComponents,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import type {
|
||||
} from "../../types/messages/get_messages.ts";
|
||||
import type { Message } from "../../types/messages/message.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
import type {SnakeCasedPropertiesDeep} from "../../types/util.ts";
|
||||
import type { SnakeCasedPropertiesDeep } from "../../types/util.ts";
|
||||
|
||||
/** Fetches between 2-100 messages. Requires VIEW_CHANNEL and READ_MESSAGE_HISTORY */
|
||||
export async function getMessages(
|
||||
@@ -20,7 +20,12 @@ export async function getMessages(
|
||||
throw new Error(bot.constants.Errors.INVALID_GET_MESSAGES_LIMIT);
|
||||
}
|
||||
|
||||
const result = await bot.rest.runMethod<SnakeCasedPropertiesDeep<Message>[]>(bot.rest, "get", bot.constants.endpoints.CHANNEL_MESSAGES(channelId), options);
|
||||
const result = await bot.rest.runMethod<SnakeCasedPropertiesDeep<Message>[]>(
|
||||
bot.rest,
|
||||
"get",
|
||||
bot.constants.endpoints.CHANNEL_MESSAGES(channelId),
|
||||
options
|
||||
);
|
||||
|
||||
return await Promise.all(result.map((res) => bot.transformers.message(bot, res)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user