command to change server icon
This commit is contained in:
parent
0fcd5f125c
commit
e19f11acae
31
commands.js
31
commands.js
@ -123,7 +123,7 @@ var commands = module.exports = [
|
||||
exec: i => commands.find(x => x.name == "steal").exec(i)
|
||||
},
|
||||
{
|
||||
name: "setbanner",
|
||||
name: "setserverbanner",
|
||||
description: "Set the server banner image",
|
||||
options: [
|
||||
{
|
||||
@ -150,6 +150,35 @@ var commands = module.exports = [
|
||||
await i.reply(error.message);
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "setservericon",
|
||||
description: "Change the server icon",
|
||||
options: [
|
||||
{
|
||||
name: "url",
|
||||
description: "HTTP(S) URL to an image",
|
||||
type: "STRING"
|
||||
}
|
||||
],
|
||||
exec: async i => {
|
||||
var url = i.options.getString("url");
|
||||
try {
|
||||
if (!url) {
|
||||
await i.guild.setIcon(null);
|
||||
await i.reply("cleared the server icon");
|
||||
} else {
|
||||
if (/^https?:\/\//i.test(url)) {
|
||||
await i.guild.setIcon(url);
|
||||
await i.reply(url);
|
||||
} else {
|
||||
await i.reply("http image url only!");
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
await i.reply(error.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user