Skip to content

Commit e57fe25

Browse files
committed
Fix Discord Messages
1 parent f273e2e commit e57fe25

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const comfyDiscord = {
7171
if( !client ) {
7272
return false;
7373
}
74-
const discordChannel = client.channels.find( ch => ch.name === channel );
74+
const discordChannel = client.channels.cache.find( ch => ch.name === channel );
7575
// console.log( discordChannel );
7676
// Do nothing if the channel wasn't found on this server
7777
if( !discordChannel ) {
@@ -82,7 +82,7 @@ const comfyDiscord = {
8282
if( opts && opts.attachment ) {
8383
const { attachment } = opts;
8484
const filename = opts.filename || attachment.substring( attachment.lastIndexOf( "/" ) + 1 );
85-
const discordAttachment = new Discord.Attachment( attachment, filename );
85+
const discordAttachment = new Discord.MessageAttachment( attachment, filename );
8686
prom = discordChannel.send( message, discordAttachment );
8787
}
8888
else {

0 commit comments

Comments
 (0)