Skip to content

Commit

Permalink
fix: deepsource doc
Browse files Browse the repository at this point in the history
  • Loading branch information
romain22222 committed Oct 23, 2023
1 parent d89097a commit 685bb52
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/commands/CommandsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,14 +310,30 @@ export class CommandsManager {
});
}

/**
* Check if the bot has the right and the permissions to send messages in the channel of the received message
* @param message
* @param client
* @private
*/
private static shouldSendHelpMessage(message: Message, client: Client): boolean {
return message.mentions.has(client.user.id) && this.hasChannelPermission(message.channel as GuildChannel)[0];
}

/**
* Check if the received message is a mass ping or a miss ping from a reply
* @param message
* @private
*/
private static isAMessageFromMassOrMissPing(message: Message): boolean {
return message.content.includes("@here") || message.content.includes("@everyone") || message.type === MessageType.Reply;
}

/**
* Check if the message comes from a bot (itself or another one) or if it's content is empty in case it's not a DM
* @param message
* @private
*/
private static isAMessageFromBotOrEmpty(message: Message): boolean {
return message.author.bot || message.author.id === draftBotClient.user.id || !message.content && message.channel.type !== ChannelType.DM;
}
Expand Down

0 comments on commit 685bb52

Please sign in to comment.