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

Method getOptionNumber

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

Source from the content-addressed store, hash-verified

197 }
198
199 getOptionNumber(key: string, defaultArg?: boolean): number | undefined {
200 if (this.type === "classic") {
201 return Number.parseFloat((defaultArg ? this.args.join(" ").trim() : this.options?.[key]) as string);
202 }
203 if (this.type === "application") {
204 return this.interaction?.data.options.getNumber(key);
205 }
206 throw Error("Unknown command type");
207 }
208
209 getOptionInteger(key: string, defaultArg?: boolean): number | undefined {
210 if (this.type === "classic") {

Callers 7

getOptionMethod · 0.95
paramsFuncMethod · 0.80
paramsFuncMethod · 0.80
paramsFuncMethod · 0.80
paramsFuncMethod · 0.80
paramsFuncMethod · 0.80
paramsFuncMethod · 0.80

Calls 1

trimMethod · 0.80

Tested by

no test coverage detected