Add banner command for users
This commit is contained in:
parent
a9f9dde789
commit
797c2b0118
1 changed files with 25 additions and 0 deletions
25
commands/info/banner.js
Normal file
25
commands/info/banner.js
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
const parseMention = require('../../util/parseMention');
|
||||||
|
module.exports = {
|
||||||
|
name: 'banner',
|
||||||
|
description: 'Shows the banners of a user',
|
||||||
|
async execute({message, args, client}) {
|
||||||
|
let info;
|
||||||
|
if (!args[0]) {
|
||||||
|
info = message.author.id;
|
||||||
|
} else {
|
||||||
|
info = parseMention(args[0], message.guild);
|
||||||
|
}
|
||||||
|
if(info === ""){
|
||||||
|
message.channel.send("Invalid user");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let forceFetchedUser = await client.users.fetch(info, {force: true});
|
||||||
|
console.log(forceFetchedUser)
|
||||||
|
let banner = forceFetchedUser.bannerURL({dynamic: true, size: 4096});
|
||||||
|
if(banner == null){
|
||||||
|
message.channel.send("User does not have a banner");
|
||||||
|
} else {
|
||||||
|
message.channel.send(banner);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
Loading…
Add table
Reference in a new issue