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