Switched source for avatar command, added alias to motivate

This commit is contained in:
TheEssem 2020-04-24 23:21:05 -05:00
parent 88dd0c6172
commit e9f4109f43
3 changed files with 5 additions and 6 deletions

View File

@ -2,17 +2,17 @@ const client = require("../utils/client.js");
exports.run = async (message, args) => {
if (message.mentions[0] !== undefined) {
return message.mentions[0].avatarURL;
return message.mentions[0].dynamicAvatarURL(null, 1024);
} else if (client.users.get(args[0]) !== undefined) {
return client.users.get(args[0]).avatarURL;
return client.users.get(args[0]).dynamicAvatarURL(null, 1024);
} else if (args.join(" ") !== "") {
const userRegex = new RegExp(args.join("|"), "i");
const member = message.channel.guild.members.find(element => {
return userRegex.test(element.nick) ? userRegex.test(element.nick) : userRegex.test(element.username);
});
return member ? member.avatarURL : message.author.avatarURL;
return member ? member.dynamicAvatarURL(null, 1024) : message.author.dynamicAvatarURL(null, 1024);
} else {
return message.author.avatarURL;
return message.author.dynamicAvatarURL(null, 1024);
}
};

View File

@ -33,6 +33,6 @@ exports.run = async (message, args) => {
};
};
exports.aliases = ["motivational", "motiv", "demotiv", "demotivational", "poster"];
exports.aliases = ["motivational", "motiv", "demotiv", "demotivational", "poster", "motivation"];
exports.category = 5;
exports.help = "Creates a motivational poster";

View File

@ -1,7 +1,6 @@
// separate the client from app.js so we can call it later
const { Client } = require("eris");
const client = new Client(process.env.TOKEN, {
defaultImageSize: 1024,
disableEvents: {
CHANNEL_CREATE: true,
CHANNEL_DELETE: true,