Skip to content

Commit

Permalink
"fix channel not defined conditional"
Browse files Browse the repository at this point in the history
  • Loading branch information
Josee9988 committed Jun 23, 2021
1 parent c316858 commit d2a1602
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/commands/commands-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export default class CommandsController {
* @param dimg the dimg object to be searched in the database.
*/
private async fetchAndSendPhoto(dimg: IDimg): Promise<void> {
if (dimg.channelId || this.client.channels.cache.get(dimg.channelId) == null) return; // channel not defined
if (dimg.channelId == null || this.client.channels.cache.get(dimg.channelId) == null) return; // channel not defined
let isDetectedAFetchFail: boolean = false;
let msg1Detected = dimg.sendMsg ? dimg.sendMsg : sendRandomPhotoMessage.msg1;
const photos: ImageInfo[] | any = await GooglePhotosAlbum.fetchImageUrls(dimg.albumLink).catch(() => isDetectedAFetchFail = true);
Expand Down

0 comments on commit d2a1602

Please sign in to comment.