This repository has been archived by the owner on Mar 5, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #95 from BigBotNetwork/greg-dev
Avatar Command
- Loading branch information
Showing
10 changed files
with
69 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
src/main/java/com/bbn/hadder/commands/fun/AvatarCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package com.bbn.hadder.commands.fun; | ||
|
||
/* | ||
* @author Skidder / GregTCLTK | ||
*/ | ||
|
||
import com.bbn.hadder.commands.Command; | ||
import com.bbn.hadder.commands.CommandEvent; | ||
import com.bbn.hadder.utils.MessageEditor; | ||
import net.dv8tion.jda.api.EmbedBuilder; | ||
import net.dv8tion.jda.api.entities.Member; | ||
|
||
public class AvatarCommand implements Command { | ||
|
||
@Override | ||
public void executed(String[] args, CommandEvent event) { | ||
if (args.length == 0) { | ||
Member member = event.getMember(); | ||
event.getTextChannel().sendMessage(new MessageEditor().setDefaultSettings(MessageEditor.MessageType.INFO, new EmbedBuilder() | ||
.setTitle("Avatar of " + member.getUser().getAsTag())) | ||
.setImage(member.getUser().getAvatarUrl()) | ||
.setFooter(member.getUser().getAsTag()) | ||
.build()).queue(); | ||
} else if (event.getMessage().getMentionedMembers().size() == 1) { | ||
Member member = event.getMessage().getMentionedMembers().get(0); | ||
event.getTextChannel().sendMessage(new MessageEditor().setDefaultSettings(MessageEditor.MessageType.INFO, new EmbedBuilder() | ||
.setTitle("Avatar of " + member.getUser().getAsTag())) | ||
.setImage(member.getUser().getAvatarUrl()) | ||
.setFooter(member.getUser().getAsTag()) | ||
.build()).queue(); | ||
} else if (args[0].length() == 18){ | ||
Member member = event.getGuild().getMemberById(args[0]); | ||
event.getTextChannel().sendMessage(new MessageEditor().setDefaultSettings(MessageEditor.MessageType.INFO, new EmbedBuilder() | ||
.setTitle("Avatar of " + member.getUser().getAsTag())) | ||
.setImage(member.getUser().getAvatarUrl()) | ||
.setFooter(member.getUser().getAsTag()) | ||
.build()).queue(); | ||
} else { | ||
event.getHelpCommand().sendHelp(this , event.getRethink(), event.getAuthor(), event.getTextChannel()); | ||
} | ||
} | ||
|
||
@Override | ||
public String[] labels() { | ||
return new String[]{"avatar"}; | ||
} | ||
|
||
@Override | ||
public String description() { | ||
return "Sends the avatar of the specified member."; | ||
} | ||
|
||
@Override | ||
public String usage() { | ||
return "<@User>/<ID>"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters