Class MessageEventSubscriber


  • public final class MessageEventSubscriber
    extends java.lang.Object
    Represents a object, holding data for message event.
    • Constructor Summary

      Constructors 
      Constructor Description
      MessageEventSubscriber​(net.dv8tion.jda.api.entities.Message message)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @NotNull net.dv8tion.jda.api.entities.MessageChannel getChannel()
      Returns the MessageChannel where the Message was sent.
      @Nullable net.dv8tion.jda.api.entities.Guild getGuild()
      Returns the Guild if the Message was sent in one.
      @NotNull net.dv8tion.jda.api.JDA getJda()
      Returns the JDA instance, from where the message event was triggered
      @Nullable net.dv8tion.jda.api.entities.Member getMember()
      Returns the Guild Member which have send the Message, if the Message was sent in a Guild.
      @NotNull net.dv8tion.jda.api.entities.Message getMessage()
      Returns the sent Message
      @Nullable net.dv8tion.jda.api.entities.PrivateChannel getPrivateChannel()
      Returns the PrivateChannel where the Message was sent, if it as sent in one.
      @Nullable net.dv8tion.jda.api.entities.TextChannel getTextChannel()
      Returns the TextChannel where the Message was sent, if it was sent in a Guild
      @NotNull net.dv8tion.jda.api.entities.User getUser()
      Returns the User, author of the Message
      boolean isGuildMessage()
      Returns whenever the Message was from Guild
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MessageEventSubscriber

        public MessageEventSubscriber​(net.dv8tion.jda.api.entities.Message message)
    • Method Detail

      • isGuildMessage

        public boolean isGuildMessage()
        Returns whenever the Message was from Guild
        Returns:
        true if from guild, false otherwise
      • getUser

        @NotNull
        public @NotNull net.dv8tion.jda.api.entities.User getUser()
        Returns the User, author of the Message
        Returns:
        author
      • getMember

        @Nullable
        public @Nullable net.dv8tion.jda.api.entities.Member getMember()
        Returns the Guild Member which have send the Message, if the Message was sent in a Guild.
        Returns:
        member
      • getGuild

        @Nullable
        public @Nullable net.dv8tion.jda.api.entities.Guild getGuild()
        Returns the Guild if the Message was sent in one.
        Returns:
        guild
      • getMessage

        @NotNull
        public @NotNull net.dv8tion.jda.api.entities.Message getMessage()
        Returns the sent Message
        Returns:
        message
      • getChannel

        @NotNull
        public @NotNull net.dv8tion.jda.api.entities.MessageChannel getChannel()
        Returns the MessageChannel where the Message was sent.
        Returns:
        channel
      • getTextChannel

        @Nullable
        public @Nullable net.dv8tion.jda.api.entities.TextChannel getTextChannel()
        Returns the TextChannel where the Message was sent, if it was sent in a Guild
        Returns:
        text channel
      • getPrivateChannel

        @Nullable
        public @Nullable net.dv8tion.jda.api.entities.PrivateChannel getPrivateChannel()
        Returns the PrivateChannel where the Message was sent, if it as sent in one.
        Returns:
        private channel
      • getJda

        @NotNull
        public @NotNull net.dv8tion.jda.api.JDA getJda()
        Returns the JDA instance, from where the message event was triggered
        Returns:
        jda