@sapphire/framework
Version:
Discord bot framework built for advanced and amazing bots.
16 lines (14 loc) • 594 B
JavaScript
import { Identifiers } from "../errors/Identifiers.mjs";
import { resolveChannel } from "./channel.mjs";
import { Result } from "@sapphire/result";
import { isDMChannel } from "@sapphire/discord.js-utilities";
//#region src/lib/resolvers/partialDMChannel.ts
function resolvePartialDMChannel(parameter, message) {
return resolveChannel(parameter, message).mapInto((channel) => {
if (isDMChannel(channel)) return Result.ok(channel);
return Result.err(Identifiers.ArgumentDMChannelError);
});
}
//#endregion
export { resolvePartialDMChannel };
//# sourceMappingURL=partialDMChannel.mjs.map