Tabnine Logo
MessageHistory.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
net.dv8tion.jda.core.entities.MessageHistory
constructor

Best Java code snippets using net.dv8tion.jda.core.entities.MessageHistory.<init> (Showing top 3 results out of 315)

origin: DV8FromTheWorld/JDA

/**
 * Creates a new {@link MessageHistory MessageHistory} object for each call of this method.
 * <br>MessageHistory is <b>NOT</b> an internal message cache, but rather it queries the Discord servers for previously sent messages.
 *
 * @throws net.dv8tion.jda.core.exceptions.InsufficientPermissionException
 *         If this is a {@link net.dv8tion.jda.core.entities.TextChannel TextChannel}
 *         and the currently logged in account does not have the permission {@link net.dv8tion.jda.core.Permission#MESSAGE_HISTORY MESSAGE_HISTORY}
 *
 * @return A {@link net.dv8tion.jda.core.entities.MessageHistory MessageHistory} related to this channel.
 */
default MessageHistory getHistory()
{
  return new MessageHistory(this);
}
origin: DV8FromTheWorld/JDA

  @Override
  protected void handleResponse(Response response, Request<MessageHistory> request)
  {
    if (!response.isOk())
    {
      request.onFailure(response);
      return;
    }
    final MessageHistory result = new MessageHistory(channel);
    final JSONArray array = response.getArray();
    final EntityBuilder builder = api.get().getEntityBuilder();
    for (int i = 0; i < array.length(); i++)
    {
      try
      {
        JSONObject obj = array.getJSONObject(i);
        result.history.put(obj.getLong("id"), builder.createMessage(obj, channel, false));
      }
      catch (JSONException | NullPointerException e)
      {
        LOG.warn("Encountered exception in MessagePagination", e);
      }
    }
    request.onSuccess(result);
  }
}
origin: FlareBot/FlareBot

  return;
MessageHistory history = new MessageHistory(channel);
int toRetrieve = amount;
int i = 0;
net.dv8tion.jda.core.entitiesMessageHistory<init>

Javadoc

Creates a new MessageHistory object.

Popular methods of MessageHistory

  • retrievePast
    Retrieves messages from Discord that were sent before the oldest sent message in MessageHistory's hi
  • checkArguments
  • getHistoryAfter
    Constructs a net.dv8tion.jda.core.entities.MessageHistory with the initially retrieved history of me
  • getHistoryAround
    Constructs a net.dv8tion.jda.core.entities.MessageHistory with the initially retrieved history of me
  • getHistoryBefore
    Constructs a net.dv8tion.jda.core.entities.MessageHistory with the initially retrieved history of me
  • getJDA
    The corresponding JDA instance for this MessageHistory
  • getMessageById
    Used to get a Message from the set of already retrieved message via it's message Id. If a Message wi
  • getRetrievedHistory
    Returns a List of Messages, sorted starting from newest to oldest, of all message that have already
  • size
    The amount of retrieved net.dv8tion.jda.core.entities.Messageby this MessageHistory. This returns 0

Popular in Java

  • Parsing JSON documents to java classes using gson
  • compareTo (BigDecimal)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • scheduleAtFixedRate (Timer)
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Path (java.nio.file)
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Reference (javax.naming)
  • JOptionPane (javax.swing)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now