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

Method getOptionString

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

Source from the content-addressed store, hash-verified

175 }
176
177 getOptionString(key: string, defaultArg?: boolean): string | undefined {
178 if (this.type === "classic") {
179 return defaultArg ? this.args.join(" ").trim() : (this.options?.[key] as string);
180 }
181 if (this.type === "application") {
182 return this.interaction?.data.options.getString(key);
183 }
184 throw Error("Unknown command type");
185 }
186
187 getOptionBoolean(key: string, defaultArg?: boolean): boolean | undefined {
188 if (this.type === "classic") {

Callers 15

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

Calls 2

trimMethod · 0.80
getStringMethod · 0.80

Tested by

no test coverage detected