(key: string, defaultArg?: boolean)
| 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") { |
no test coverage detected