Skip to content

Commit

Permalink
Remove useless null checks
Browse files Browse the repository at this point in the history
  • Loading branch information
tapnisu committed Aug 22, 2024
1 parent 05993c1 commit d82b616
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ export class Bot extends Client {
this.messageAction(message);
});

if (config.showMessageUpdates ?? false)
if (config.showMessageUpdates)
this.on("messageUpdate", (_oldMessage, newMessage) => {
this.messageAction(newMessage, "updated");
});

if (config.showMessageDeletions ?? false)
if (config.showMessageDeletions)
this.on("messageDelete", (message) => {
this.messageAction(message, "deleted");
});
Expand Down Expand Up @@ -113,7 +113,7 @@ export class Bot extends Client {
if (embed.image) {
stringEmbed += ` Image: ${embed.image.url}\n`;

if (this.config.imagesAsMedia ?? true)
if (this.config.imagesAsMedia)
images.push(InputMediaBuilder.photo(embed.image.url));
}
if (embed.video) stringEmbed += ` Video: ${embed.video.url}\n`;
Expand All @@ -127,7 +127,7 @@ export class Bot extends Client {

for (const attachment of message.attachments.values()) {
if (
(this.config.imagesAsMedia ?? true) &&
this.config.imagesAsMedia &&
attachment.contentType &&
attachment.contentType.startsWith("image") &&
attachment.size < 10 * 1024 * 1024
Expand Down

0 comments on commit d82b616

Please sign in to comment.