@sapphire/framework
Version:
Discord bot framework built for advanced and amazing bots.
16 lines (14 loc) • 604 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/dmChannel.ts
function resolveDMChannel(parameter, messageOrInteraction) {
return resolveChannel(parameter, messageOrInteraction).mapInto((value) => {
if (isDMChannel(value) && !value.partial) return Result.ok(value);
return Result.err(Identifiers.ArgumentDMChannelError);
});
}
//#endregion
export { resolveDMChannel };
//# sourceMappingURL=dmChannel.mjs.map