MCPcopy Create free account
hub / github.com/esmBot/esmBot / getOptionMember

Method getOptionMember

src/classes/command.ts:230–239  ·  view source on GitHub ↗
(key: string, defaultArg?: boolean)

Source from the content-addressed store, hash-verified

228 }
229
230 getOptionMember(key: string, defaultArg?: boolean): Member | undefined {
231 if (this.type === "classic") {
232 const id = defaultArg ? this.args.join(" ").trim() : this.options?.[key];
233 return this.guild?.members.get(id as string);
234 }
235 if (this.type === "application") {
236 return this.interaction?.data.options.getMember(key);
237 }
238 throw Error("Unknown command type");
239 }
240
241 getOptionRole(key: string, defaultArg?: boolean): Role | undefined {
242 if (this.type === "classic") {

Callers 2

runMethod · 0.80
runMethod · 0.80

Calls 1

trimMethod · 0.80

Tested by

no test coverage detected