diff --git a/src/main/java/net/romvoid/crashbot/Bot.java b/src/main/java/net/romvoid/crashbot/Bot.java index 616e246..1e43788 100644 --- a/src/main/java/net/romvoid/crashbot/Bot.java +++ b/src/main/java/net/romvoid/crashbot/Bot.java @@ -33,6 +33,7 @@ import javax.security.auth.login.LoginException; +import net.romvoid.crashbot.commands.Kot666Command; import net.romvoid.crashbot.commands.StatusCommand; import org.jivesoftware.smack.AbstractXMPPConnection; @@ -106,7 +107,7 @@ client.setEmojis("\uD83D\uDE03", "\uD83D\uDE2E", "\uD83D\uDE26"); client.setPrefix(prefix); - client.addCommands(new InviteCommand(), new GuildlistCommand(waiter), new GitCommand(), new StatusCommand()); + client.addCommands(new InviteCommand(), new GuildlistCommand(waiter), new GitCommand(), new StatusCommand(), new Kot666Command()); initJDA(); initJabber(); diff --git a/src/main/java/net/romvoid/crashbot/commands/Kot666Command.java b/src/main/java/net/romvoid/crashbot/commands/Kot666Command.java new file mode 100644 index 0000000..622389d --- /dev/null +++ b/src/main/java/net/romvoid/crashbot/commands/Kot666Command.java @@ -0,0 +1,36 @@ +package net.romvoid.crashbot.commands; + +import java.awt.*; +import java.util.concurrent.TimeUnit; + +import com.jagrosh.jdautilities.command.Command; +import com.jagrosh.jdautilities.command.CommandEvent; + +import net.dv8tion.jda.api.EmbedBuilder; +import net.dv8tion.jda.api.Permission; +import net.dv8tion.jda.api.entities.Message; +import net.dv8tion.jda.api.entities.MessageChannel; +import net.romvoid.crashbot.Bot; +import net.romvoid.crashbot.utilities.EmbedUtil; + +public class Kot666Command extends Command { + + public Kot666Command() { + this.name = "kot666"; + this.help = "kot666"; + this.botPermissions = new Permission[]{Permission.MESSAGE_EMBED_LINKS}; + this.guildOnly = false; + } + + @Override + protected void execute(CommandEvent event) { + Bot.LOG.info(event.getAuthor().getName() + " invoked command " + this.name); + + MessageChannel channel = event.getChannel(); + EmbedBuilder embed = EmbedUtil.embed(" ",""); + embed.setColor(new Color(41, 128, 185)).setImage("https://mfnd.ru/?mode=file&uniq=mdpQAixZSyPe"); + Message msg = EmbedUtil.message(embed); + EmbedUtil.sendAndDeleteOnGuilds(channel, msg, -1, TimeUnit.MINUTES); + event.getMessage().delete().queue(); + } +}