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

Method getOptionBoolean

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

Source from the content-addressed store, hash-verified

185 }
186
187 getOptionBoolean(key: string, defaultArg?: boolean): boolean | undefined {
188 if (this.type === "classic") {
189 const option = defaultArg ? this.args.join(" ").trim() : this.options?.[key];
190 if (option) return !!option;
191 else return;
192 }
193 if (this.type === "application") {
194 return this.interaction?.data.options.getBoolean(key);
195 }
196 throw Error("Unknown command type");
197 }
198
199 getOptionNumber(key: string, defaultArg?: boolean): number | undefined {
200 if (this.type === "classic") {

Callers 13

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