Updated readme, check if bot has permissions to send messages
This commit is contained in:
parent
3a02efef70
commit
1e8c7a6497
5 changed files with 8 additions and 5 deletions
|
@ -10,6 +10,9 @@ module.exports = async (message) => {
|
|||
if (message.author.bot) return;
|
||||
if (!message.channel.guild) return;
|
||||
|
||||
// don't run command if bot can't send messages
|
||||
if (!message.channel.guild.members.get(client.user.id).permission.has("sendMessages") && !message.channel.permissionsOf(client.user.id).has("sendMessages")) return;
|
||||
|
||||
// prefix can be a mention or a set of special characters
|
||||
const prefixMention = new RegExp(`^<@!?${client.user.id}> `);
|
||||
const guildConf = (await database.guilds.find({ id: message.channel.guild.id }).exec())[0];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue