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

Method getOptionAttachment

src/classes/command.ts:253–261  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

251
252 // Note: the key is unused in a classic command context.
253 getOptionAttachment(key: string): Attachment | undefined {
254 if (this.type === "classic") {
255 return this.message?.attachments.first();
256 }
257 if (this.type === "application") {
258 return this.interaction?.data.options.getAttachment(key);
259 }
260 throw Error("Unknown command type");
261 }
262
263 clean(text: string) {
264 if (this.message) {

Callers 2

getOptionMethod · 0.95
runMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected