Release v1.0.0 #345

Merged
greg6775 merged 68 commits from greg-dev into master 2020-01-24 17:49:10 +01:00
2 changed files with 27 additions and 16 deletions
Showing only changes of commit 6b09db43d9 - Show all commits

View file

@ -1,13 +1,14 @@
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.entities.Member;
import net.dv8tion.jda.api.entities.User;
/**
* @author Skidder / GregTCLTK
*/
public class AvatarCommand implements Command {
@ -37,18 +38,26 @@ public class AvatarCommand implements Command {
.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(
event.getMessageEditor().getMessage(
MessageEditor.MessageType.INFO,
"commands.fun.avatar.success.title",
member.getUser().getAsTag(),
"",
"")
.setImage(member.getUser().getAvatarUrl())
.setFooter(member.getUser().getAsTag())
.build()).queue();
} else if (args[0].length() == 18) {
try {
User u = event.getGuild().getMemberById(args[0]).getUser();
event.getTextChannel().sendMessage(
event.getMessageEditor().getMessage(
MessageEditor.MessageType.INFO,
"commands.fun.avatar.success.title",
u.getAsTag(),
"",
"")
.setImage(u.getAvatarUrl())
.setFooter(u.getAsTag())
.build()).queue();
} catch (NullPointerException e) {
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR,
"commands.fun.avatar.error.title",
"commands.fun.avatar.error.description"
).build()).queue();
}
} else {
event.getHelpCommand().sendHelp(this, event);
}

View file

@ -9,6 +9,8 @@ none = None
success\! = Success\!
commands.fun.avatar.success.title = Avatar of %extra%
commands.fun.avatar.error.title = User not found
commands.fun.avatar.error.description = I can not find a user with this id!
commands.fun.avatar.help.description = Sends the avatar of the specified member.
commands.fun.gif.error.description = Please try again with another term.
commands.fun.gif.help.description = Looks for a GIF on Giphy.