Switched source for avatar command, added alias to motivate
This commit is contained in:
parent
88dd0c6172
commit
e9f4109f43
3 changed files with 5 additions and 6 deletions
|
@ -2,17 +2,17 @@ const client = require("../utils/client.js");
|
||||||
|
|
||||||
exports.run = async (message, args) => {
|
exports.run = async (message, args) => {
|
||||||
if (message.mentions[0] !== undefined) {
|
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) {
|
} 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(" ") !== "") {
|
} else if (args.join(" ") !== "") {
|
||||||
const userRegex = new RegExp(args.join("|"), "i");
|
const userRegex = new RegExp(args.join("|"), "i");
|
||||||
const member = message.channel.guild.members.find(element => {
|
const member = message.channel.guild.members.find(element => {
|
||||||
return userRegex.test(element.nick) ? userRegex.test(element.nick) : userRegex.test(element.username);
|
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 {
|
} else {
|
||||||
return message.author.avatarURL;
|
return message.author.dynamicAvatarURL(null, 1024);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -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.category = 5;
|
||||||
exports.help = "Creates a motivational poster";
|
exports.help = "Creates a motivational poster";
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
// separate the client from app.js so we can call it later
|
// separate the client from app.js so we can call it later
|
||||||
const { Client } = require("eris");
|
const { Client } = require("eris");
|
||||||
const client = new Client(process.env.TOKEN, {
|
const client = new Client(process.env.TOKEN, {
|
||||||
defaultImageSize: 1024,
|
|
||||||
disableEvents: {
|
disableEvents: {
|
||||||
CHANNEL_CREATE: true,
|
CHANNEL_CREATE: true,
|
||||||
CHANNEL_DELETE: true,
|
CHANNEL_DELETE: true,
|
||||||
|
|
Loading…
Reference in a new issue