change createMessage to send (eris to d.js)

This commit is contained in:
Emily 2021-07-15 12:39:19 +10:00
parent abc21ac158
commit 9d0fd0ee01
23 changed files with 71 additions and 71 deletions

View file

@ -24,14 +24,14 @@ module.exports = class {
list.push(`${user.username}#${user.discriminator}`);
}
if (list.length === 0) return message.channel.createMessage('The server blocklist is currently empty. Use `blocklist add <user>` to add people to the blocklist!');
if (list.length === 0) return message.channel.send('The server blocklist is currently empty. Use `blocklist add <user>` to add people to the blocklist!');
const embed = new client.RichEmbed()
.setTitle('Users on blocklist: ' + data.guild.blocklist.length)
.setDescription('```' + list.join(', ') + '```')
.setColour(client.functions.displayHexColour(message.channel.guild));
message.channel.createMessage({ embed: embed });
message.channel.send({ embed: embed });
return;
}
@ -39,10 +39,10 @@ module.exports = class {
action = action.toLowerCase();
if (action !== 'add' & action !== 'remove') {
return message.channel.createMessage(`${client.config.emojis.userError} You didn't specify a valid action. Usage: \`${this.help.usage}\``);
return message.channel.send(`${client.config.emojis.userError} You didn't specify a valid action. Usage: \`${this.help.usage}\``);
}
if (!user) return message.channel.createMessage(
if (!user) return message.channel.send(
`${client.config.emojis.userError} You didn't specify a user. Usage: \`${message.prefix + this.help.usage}\``
);
@ -56,11 +56,11 @@ module.exports = class {
if (!member) {
member = await message.channel.guild.searchMembers(user.join(' '), 2);
if (member.length === 0) return message.channel.createMessage(
if (member.length === 0) return message.channel.send(
`${client.config.emojis.userError} No users found. Check for mispellings, or ping the user instead.`
);
if (member.length > 1) return message.channel.createMessage(
if (member.length > 1) return message.channel.send(
`${client.config.emojis.userError} Found more than one user, try refining your search or pinging the user instead.`
);
@ -71,25 +71,25 @@ module.exports = class {
const blocklist = data.guild.blocklist;
if (action === 'add') {
if (member.id === message.channel.guild.ownerID) return message.channel.createMessage(
if (member.id === message.channel.guild.ownerID) return message.channel.send(
`${client.config.emojis.userError} You can't block the owner, silly!`
);
if (client.functions.highestRole(member).position >= client.functions.highestRole(message.member).position && message.member.id !== message.channel.guild.ownerID) {
return message.channel.createMessage(`${client.config.emojis.userError} This user has a higher role than you, you can't add them to the blocklist!`);
return message.channel.send(`${client.config.emojis.userError} This user has a higher role than you, you can't add them to the blocklist!`);
}
if (blocklist.includes(member.id)) return message.channel.createMessage(
if (blocklist.includes(member.id)) return message.channel.send(
`${client.config.emojis.userError} This user is already on the blocklist, you can't add them twice!`
);
blocklist.push(member.id);
client.db.updateGuild(message.channel.guild.id, 'blocklist', blocklist).then(() => {
message.channel.createMessage(`${client.config.emojis.success} Added \`${member.username}#${member.discriminator}\` to the blocklist.`);
message.channel.send(`${client.config.emojis.success} Added \`${member.username}#${member.discriminator}\` to the blocklist.`);
}).catch(error => {
client.logger.error('GUILD_UPDATE_ERROR', error);
message.channel.createMessage(`${client.config.emojis.botError} An error occured while adding this user to the blocklist, please try again! **Error:** ${error}`);
message.channel.send(`${client.config.emojis.botError} An error occured while adding this user to the blocklist, please try again! **Error:** ${error}`);
}) ;
return;
@ -97,20 +97,20 @@ module.exports = class {
if (action === 'remove') {
if (client.functions.highestRole(member).position >= client.functions.highestRole(message.member).position && message.member.id !== message.channel.guild.ownerID) {
return message.channel.createMessage(`${client.config.emojis.userError} This user has a higher role than you, you can't remove them to the blocklist!`);
return message.channel.send(`${client.config.emojis.userError} This user has a higher role than you, you can't remove them to the blocklist!`);
}
if (!blocklist.includes(member.id)) return message.channel.createMessage(
if (!blocklist.includes(member.id)) return message.channel.send(
`${client.config.emojis.userError} This user isn't on the blocklist.`
);
blocklist.remove(member.id);
client.db.updateGuild(message.channel.guild.id, 'blocklist', blocklist).then(() => {
message.channel.createMessage(`${client.config.emojis.success} Removed \`${member.username}#${member.discriminator}\` from the blocklist.`);
message.channel.send(`${client.config.emojis.success} Removed \`${member.username}#${member.discriminator}\` from the blocklist.`);
}).catch(error => {
client.logger.error('GUILD_UPDATE_ERROR', error);
message.channel.createMessage(`${client.config.emojis.botError} An error occured while removing this user from the blocklist, please try again! **Error:** ${error}`);
message.channel.send(`${client.config.emojis.botError} An error occured while removing this user from the blocklist, please try again! **Error:** ${error}`);
}) ;
return;

View file

@ -26,7 +26,7 @@ module.exports = class {
return;
}
if (!args[1]) return message.channel.createMessage(
if (!args[1]) return message.channel.send(
`${client.config.emojis.userError} You didn't specify what command/category to disable. Usage: \`${this.help.usage}\``
);
@ -41,17 +41,17 @@ module.exports = class {
command = client.commands.get(client.aliases.get(args[1]));
}
if (!command) return message.channel.createMessage(
if (!command) return message.channel.send(
`${client.config.emojis.userError} ${args[1]} isn't a command or an alias, are you sure you spelt it correctly?`
);
if (essential.commands.includes(command.name) || essential.categories.includes(command.category)) {
return message.channel.createMessage(
return message.channel.send(
`${client.config.emojis.userError} This command is essential and cannot be disabled. Sorry!`
);
}
if (disabled.includes(command.name)) return message.channel.createMessage(
if (disabled.includes(command.name)) return message.channel.send(
`${client.config.emojis.userError} This command is already disabled.`
);
@ -59,7 +59,7 @@ module.exports = class {
await client.db.updateGuild(message.channel.guild.id, 'disabledcommands', disabled);
return message.channel.createMessage(
return message.channel.send(
`${client.config.emojis.success} Added **${args[1]}** to the list of disabled commands for this server.`
);
}
@ -75,11 +75,11 @@ module.exports = class {
command = client.commands.get(client.aliases.get(args[1]));
}
if (!command) return message.channel.createMessage(
if (!command) return message.channel.send(
`${client.config.emojis.userError} ${args[1]} isn't a category, are you sure you spelt it correctly?`
);
if (!disabled.includes(command.name)) return message.channel.createMessage(
if (!disabled.includes(command.name)) return message.channel.send(
`${client.config.emojis.userError} This category isn't disabled.`
);
@ -87,7 +87,7 @@ module.exports = class {
await client.db.updateGuild(message.channel.guild.id, 'disabledcommands', disabled);
return message.channel.createMessage(
return message.channel.send(
`${client.config.emojis.success} Added **${args[1]}** to the list of disabled category for this server!`
);
}

View file

@ -18,14 +18,14 @@ module.exports = class {
async run (client, message, args, data) {
if (!args[0]) {
return message.channel.createMessage(
return message.channel.send(
`Your prefix for Woomy is currently: \`${data.user.prefix}\``
);
}
await client.db.updateUser(message.author.id, 'prefix', args[0]);
message.channel.createMessage(
message.channel.send(
`${client.config.emojis.success} Your personal prefix has been set to: \`${args[0]}\``
);
}