I was upgrading a ban command for my Discord bot (Discord.js). This is my command now (without some unnecessary code):
const target = message.mentions.users.first();
if (target) {
const memberTarget = message.guild.members.cache.get(target.id);
memberTarget.ban();
message.channel.send(
`<@${memberTarget.user.id}> got 360 no-scoped by ${message.bot.username}`
);
} else {
message.channel.send(process.env.MSGERR);
}
},
The problem here is that message.bot.username is not working. I have multiple bots, so I would like the bot username as a variable. When I tried message.author.username, it does work.
So my question is what is the bot variant of the message.author.username?