Skip to content

Commit

Permalink
attempt at fixing quick replies
Browse files Browse the repository at this point in the history
  • Loading branch information
maanex committed May 26, 2023
1 parent 5753399 commit 52f86e4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/modules/quickreplies.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GuildMember, Message, TextChannel } from 'discord.js'
import { GuildMember, Message, TextChannel, ThreadChannel } from 'discord.js'
import * as fuzzy from 'fuzzy'
import { QuickRepliesMainPageData } from '../cordo/states/quickreplies/main'
import Database from '../database/database'
Expand Down Expand Up @@ -234,13 +234,13 @@ export default class QuickRepliesModule extends Module {
)
}

private async sendReply(channel: TextChannel, member: GuildMember, text: string, pingUser?: string) {
private async sendReply(channel: TextChannel | ThreadChannel, member: GuildMember, text: string, pingUser?: string) {
if (!text) return

try {
const webhook = await Webhooks.allocateWebhook(channel)
webhook.send({
threadId: channel.isThread ? channel.id : undefined,
threadId: channel.isThread() ? channel.id : undefined,
content: text,
avatarURL: member.user.avatarURL(),
username: member.nickname || member.user.username,
Expand Down

0 comments on commit 52f86e4

Please sign in to comment.