Everybody needs a hug :)

This commit is contained in:
ConCode 2021-02-16 13:30:39 +01:00
parent b488aeef15
commit 6b0ab6ed37
2 changed files with 35 additions and 5 deletions

View file

@ -0,0 +1,33 @@
package com.github.nilstrieb.commands.fun;
import com.github.nilstrieb.cofig.Config;
import com.github.nilstrieb.core.command.Command;
import net.dv8tion.jda.api.EmbedBuilder;
import net.dv8tion.jda.api.entities.Member;
import java.util.List;
import java.util.Objects;
public class HugCommand extends Command {
public HugCommand() {
super("hug", "Get and give some hugs :)", "hug @Clyde#0000", "");
}
@Override
public void called(String args) {
Member member = event.getMember();
List<Member> mentions = event.getMessage().getMentionedMembers();
EmbedBuilder builder = Config.getDefaultEmbed();
if (mentions.size() == 1 && !mentions.get(0).getId().equalsIgnoreCase(Objects.requireNonNull(member).getId())) {
member = mentions.get(0);
builder.setDescription(mentions.get(0).getEffectiveName() +" is giving " + member.getEffectiveName() + " a hug! :)");
} else {
builder.setDescription("Get a hug, bro <3");
}
builder.setImage("https://namespace.media/img/images/2021/02/15/7f76102bedf6de4e34065709d16a9ef8.gif");
reply(builder.build());
}
}

View file

@ -1,11 +1,7 @@
package com.github.nilstrieb.core;
import com.github.nilstrieb.cofig.Config;
import com.github.nilstrieb.cofig.Secrets;
import com.github.nilstrieb.commands.fun.DepartureCommand;
import com.github.nilstrieb.commands.fun.FightCommand;
import com.github.nilstrieb.commands.fun.QuoteCommand;
import com.github.nilstrieb.commands.fun.SayCommand;
import com.github.nilstrieb.commands.fun.*;
import com.github.nilstrieb.commands.fun.trivia.TriviaCommand;
import com.github.nilstrieb.commands.info.InviteCommand;
import com.github.nilstrieb.commands.info.EvalCommand;
@ -84,5 +80,6 @@ public class Main {
new TriviaCommand();
new EmoteAddCommand();
new FightCommand();
new HugCommand();
}
}