Do not add bot's nickname if it's the bot user
This commit is contained in:
parent
f9097ae68d
commit
72f4648ff9
1 changed files with 2 additions and 1 deletions
|
@ -81,7 +81,8 @@ function formatName(name: string): string {
|
|||
* @param message the message to get the author name
|
||||
* @returns the proper author name of the message
|
||||
*/
|
||||
function getAuthorUsername(message: DiscordMessage): string {
|
||||
function getAuthorUsername(message: DiscordMessage): string | undefined {
|
||||
if (message.author.id === message.client.user.id ) return undefined;
|
||||
if (message.member) {
|
||||
const name = formatName(message.member.displayName);
|
||||
if (name.length >= 3) return name;
|
||||
|
|
Loading…
Reference in a new issue