Skip to content

Commit

Permalink
fix: check if isThread exists (fixed #41)
Browse files Browse the repository at this point in the history
  • Loading branch information
ItzDerock committed Jun 19, 2022
1 parent dc15e14 commit 3a5883b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/exporthtml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,13 @@ async function generateTranscript<T extends ReturnTypes>(
if(
(isDJSv14
? channelTemp.type === 1 // djs v14 uses 1 for dm
: channelTemp.type === "DM")
|| inputChannel.isThread()
: channelTemp.type === "DM"
)
||
(
typeof inputChannel.isThread === "function"
&& inputChannel.isThread()
)
) throw new Error("Cannot operate on DM channels or thread channels");

const channel = inputChannel as (discordv13.NewsChannel | discordv13.TextChannel);
Expand Down Expand Up @@ -158,7 +163,6 @@ async function generateTranscript<T extends ReturnTypes>(

// message content
if(message.content) {
console.log(message.content, validateURL(message.content));
if (validateURL(message.content)) {
var link = document.createElement('a');
link.classList.add('chatlog__content');
Expand Down

0 comments on commit 3a5883b

Please sign in to comment.