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

Method getOptionInteger

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

Source from the content-addressed store, hash-verified

207 }
208
209 getOptionInteger(key: string, defaultArg?: boolean): number | undefined {
210 if (this.type === "classic") {
211 return Number.parseInt((defaultArg ? this.args.join(" ").trim() : this.options?.[key]) as string);
212 }
213 if (this.type === "application") {
214 return this.interaction?.data.options.getInteger(key);
215 }
216 throw Error("Unknown command type");
217 }
218
219 getOptionUser(key: string, defaultArg?: boolean): User | undefined {
220 if (this.type === "classic") {

Callers 8

getOptionMethod · 0.95
runMethod · 0.80
runMethod · 0.80
runMethod · 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