Skip to content

Commit

Permalink
feat(structures/Webhook): support sending multiple files (#276)
Browse files Browse the repository at this point in the history
  • Loading branch information
DjDeveloperr authored Dec 17, 2021
1 parent f129b8d commit fb96498
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/structures/webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export class Webhook {
? (option as WebhookMessageOptions).embeds
: undefined,
file: (option as WebhookMessageOptions)?.file,
files: (option as WebhookMessageOptions)?.files,
tts: (option as WebhookMessageOptions)?.tts,
allowed_mentions: (option as WebhookMessageOptions)?.allowedMentions,
username: undefined as undefined | string,
Expand Down
8 changes: 8 additions & 0 deletions test/webhook.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Webhook, MessageAttachment } from '../mod.ts'

const hook = await Webhook.fromURL(Deno.env.get('WEBHOOK')!)
await hook.send({
file: await MessageAttachment.load(
'https://cdn.discordapp.com/emojis/783639203153575948.png?size=96'
)
})

0 comments on commit fb96498

Please sign in to comment.