Skip to content

Commit

Permalink
🐛 fix: webhook editMessage doesnt work when no client is set
Browse files Browse the repository at this point in the history
  • Loading branch information
Helloyunho committed Apr 28, 2024
1 parent b890958 commit 9ca7082
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion deps.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { EventEmitter } from 'https://deno.land/x/[email protected].0/mod.ts'
export { EventEmitter } from 'jsr:@denosaurs/[email protected].2'
export { decompress_with as unzlib } from 'npm:@evan/[email protected]/target/zlib/node.mjs'
export { walk } from 'jsr:@std/[email protected]/walk'
export { join } from 'node:path'
Expand Down
8 changes: 4 additions & 4 deletions src/structures/webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,10 @@ export class Webhook {
}
}
): Promise<Webhook> {
await this.client?.rest.patch(
await this.rest.patch(
WEBHOOK_MESSAGE(
this.id,
(this.token ?? this.client.token) as string,
(this.token ?? this.client?.token) as string,
typeof message === 'string' ? message : message.id
),
data
Expand All @@ -216,10 +216,10 @@ export class Webhook {
}

async deleteMessage(message: string | Message): Promise<Webhook> {
await this.client?.rest.delete(
await this.rest.delete(
WEBHOOK_MESSAGE(
this.id,
(this.token ?? this.client.token) as string,
(this.token ?? this.client?.token) as string,
typeof message === 'string' ? message : message.id
)
)
Expand Down

0 comments on commit 9ca7082

Please sign in to comment.