@sapphire/framework
Version:
Discord bot framework built for advanced and amazing bots.
27 lines (25 loc) • 794 B
JavaScript
import { resolvePartialDMChannel } from "../lib/resolvers/partialDMChannel.mjs";
import { Argument } from "../lib/structures/Argument.mjs";
import { container } from "@sapphire/pieces";
//#region src/arguments/CorePartialDMChannel.ts
var CoreArgument = class extends Argument {
constructor(context) {
super(context, { name: "partialDMChannel" });
}
run(parameter, context) {
return resolvePartialDMChannel(parameter, context.message).mapErrInto((identifier) => this.error({
parameter,
identifier,
message: "The argument did not resolve to a Partial DM channel.",
context
}));
}
};
container.stores.loadPiece({
name: "partialDMChannel",
piece: CoreArgument,
store: "arguments"
});
//#endregion
export { CoreArgument };
//# sourceMappingURL=CorePartialDMChannel.mjs.map