Skip to content
Permalink
Browse files

Added /avatar command

  • Loading branch information...
TempusWare committed Aug 8, 2019
1 parent bfaa2c0 commit b2eb68bf7bd934c3bffd7d004011697fc90bec9b
Showing with 21 additions and 0 deletions.
  1. +2 −0 README.md
  2. +19 −0 index.js
@@ -57,3 +57,5 @@ Generate a random number.\
End a game started in a server. No permissions are required.\
**Subcommands:**
- (game)
##### /avatar
Get a person's avatar
@@ -400,6 +400,25 @@ client.on("message", async message => {
message.author.send(`You have started a game of hangman in **${message.channel.name}**. What's the word?`);
break;

case "avatar":
if (message.mentions.users.size) {
var tagged = message.mentions.users.first();
if (tagged.avatarURL) {
var url = tagged.avatarURL;
message.channel.send(message.author, {files: [url.substr(0, url.length - 9)]});
} else {
message.reply("That user doesn't have an avatar!");
};
} else {
if (message.author.avatarURL) {
var url = message.author.avatarURL;
message.channel.send(message.author, {files: [url.substr(0, url.length - 9)]});
} else {
message.reply("You don't have an avatar!");
};
};
break;

default:
message.reply(reusedMessages.invalidcommand);
break;

0 comments on commit b2eb68b

Please sign in to comment.
You can’t perform that action at this time.