| 228 | } |
| 229 | |
| 230 | getOptionMember(key: string, defaultArg?: boolean): Member | undefined { |
| 231 | if (this.type === "classic") { |
| 232 | const id = defaultArg ? this.args.join(" ").trim() : this.options?.[key]; |
| 233 | return this.guild?.members.get(id as string); |
| 234 | } |
| 235 | if (this.type === "application") { |
| 236 | return this.interaction?.data.options.getMember(key); |
| 237 | } |
| 238 | throw Error("Unknown command type"); |
| 239 | } |
| 240 | |
| 241 | getOptionRole(key: string, defaultArg?: boolean): Role | undefined { |
| 242 | if (this.type === "classic") { |