UNPKG

@sapphire/framework

Version:

Discord bot framework built for advanced and amazing bots.

20 lines (18 loc) 731 B
import { __name } from '../../chunk-PAWJFY3S.mjs'; import { isDMChannel } from '@sapphire/discord.js-utilities'; import { Result } from '@sapphire/result'; import { Identifiers } from '../errors/Identifiers.mjs'; import { resolveChannel } from './channel.mjs'; function resolveDMChannel(parameter, messageOrInteraction) { const result = resolveChannel(parameter, messageOrInteraction); return result.mapInto((value) => { if (isDMChannel(value) && !value.partial) { return Result.ok(value); } return Result.err(Identifiers.ArgumentDMChannelError); }); } __name(resolveDMChannel, "resolveDMChannel"); export { resolveDMChannel }; //# sourceMappingURL=dmChannel.mjs.map //# sourceMappingURL=dmChannel.mjs.map