utility.banner: server support

This commit is contained in:
Cynthia Foxwell 2021-08-26 11:18:50 -06:00
parent 4c718e3a9a
commit 3e2a3cd567

View file

@ -137,7 +137,28 @@ banner.usage = "<user>";
banner.callback = async function (msg, line) {
let id = msg.author.id;
if (line) {
if (line == "--server" || line == "--guild") {
if (!msg.channel.guild) {
return "`--server/--guild` can only be used within guilds.";
} else {
const url = `${BANNER_BASE}${msg.channel.guild.id}/${
msg.channel.guild.banner
}.${
msg.channel.guild.banner.startsWith("a_")
? "gif?size=1024&_=.gif"
: "png?size=1024"
}`;
return {
embed: {
title: "Server Banner",
url,
image: {
url,
},
},
};
}
} else if (line) {
const lookup = await lookupUser(msg, line);
if (
lookup == "No results" ||