diff --git a/src/main/java/moe/oko/Kiafumi/listener/MainListener.java b/src/main/java/moe/oko/Kiafumi/listener/MainListener.java index 445397a..67cbcea 100644 --- a/src/main/java/moe/oko/Kiafumi/listener/MainListener.java +++ b/src/main/java/moe/oko/Kiafumi/listener/MainListener.java @@ -10,12 +10,14 @@ import net.dv8tion.jda.api.events.ReadyEvent; import net.dv8tion.jda.api.events.guild.GuildJoinEvent; import net.dv8tion.jda.api.events.guild.member.GuildMemberJoinEvent; import net.dv8tion.jda.api.events.guild.member.GuildMemberRemoveEvent; +import net.dv8tion.jda.api.events.message.MessageReceivedEvent; import net.dv8tion.jda.api.events.user.update.GenericUserPresenceEvent; import net.dv8tion.jda.api.hooks.ListenerAdapter; import org.jetbrains.annotations.NotNull; import java.awt.*; import java.time.OffsetDateTime; +import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; import java.util.Timer; import java.util.TimerTask; @@ -49,6 +51,22 @@ public class MainListener extends ListenerAdapter { " Guilds Active: " + event.getGuildAvailableCount() + " Guilds Unavailable: " + event.getGuildUnavailableCount()); } + /** + * Quick Response for if someone pings me. + */ + public void onMessageReceived(MessageReceivedEvent event) { + if(event.getMessage().getMentionedUsers().contains(Kiafumi.JDA.getSelfUser())) { + EmbedBuilder eb = new EmbedBuilder() + .setColor(Color.PINK) + .setImage(Kiafumi.JDA.getSelfUser().getAvatarUrl()) + .setTitle("Hi, i'm Kiafumi!") + .setDescription("I was born on October 6th 2017! My goal is to explore the metaverse and help people in it!") + .setTimestamp(ZonedDateTime.now()) + .setFooter("Kiafumi - Maintained by oko.moe"); + event.getChannel().sendMessageEmbeds(eb.build()).queue(); + } + } + /** * Game Prevention, is a global mechanic :^) * @param event - GenericUserPresenceEvent event to be used.