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

Method getOptionUser

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

Source from the content-addressed store, hash-verified

217 }
218
219 getOptionUser(key: string, defaultArg?: boolean): User | undefined {
220 if (this.type === "classic") {
221 const id = defaultArg ? this.args.join(" ").trim() : this.options?.[key];
222 return this.client.users.get(id as string);
223 }
224 if (this.type === "application") {
225 return this.interaction?.data.options.getUser(key);
226 }
227 throw Error("Unknown command type");
228 }
229
230 getOptionMember(key: string, defaultArg?: boolean): Member | undefined {
231 if (this.type === "classic") {

Callers 4

getOptionMethod · 0.95
runMethod · 0.80
runMethod · 0.80
runMethod · 0.80

Calls 1

trimMethod · 0.80

Tested by

no test coverage detected