From c2e181f5bbb22217a9bcd61ac9ee865c60ca9a54 Mon Sep 17 00:00:00 2001 From: hydrabolt Date: Thu, 29 Oct 2015 18:37:45 +0000 Subject: [PATCH] Missed messages details --- docs/docs_client.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/docs_client.rst b/docs/docs_client.rst index c33098212..ea0718c88 100644 --- a/docs/docs_client.rst +++ b/docs/docs_client.rst @@ -9,6 +9,28 @@ It might be beneficial to use CTRL+F to search for what you're looking for, or u .. note:: As of 3.10.1, Discord.Client extends EventEmitter_. In previous versions, the only available methods were `on` and `off`. +Missed Messages +--------------- + +As of version 4.1.0, Clients now have the ability to find all the messages they missed and then emit them as `message` events. To opt-in for catching up on messages, just instantiate your client like so: + +.. code-block:: js + + var client = new Discord.Client({ + catchup : "all" + /* this setup will force the client to get ALL + the messages the client has missed */ + }); + + var client = new Discord.Client({ + catchup : "fast" + /* this setup will get the last 2500 + missed messages, which can be faster + and easier on resources */ + }); + +Messages that have been caught up with will be emitted as a `message` event with the extra parameter `caughtup` which will be true. This allows you to differentiate real-time messages and caught-up ones. + Attributes ---------- @@ -20,6 +42,7 @@ An `Object` containing a configuration for the Client. Currently can only be con { compress : false // whether packets >50kb should be received compressed and later decompressed + catchup : false // read above ^^ } token