Skip to content

Instantly share code, notes, and snippets.

What would you like to do?

<limit> is defined by the server/bouncer by default, but the client can optionally ask for a different limit.

CHATHISTORY #ircv3 BEFORE id=ytNBbt565yt4r3err3 [<limit>]
    - get up to <limit> number of messages before the given id/time
CHATHISTORY #ircv3 AFTER id=ytNBbt565yt4r3err3 [<limit>]
    - get up to <limit> number of messages after the given id/time
CHATHISTORY #ircv3 LATEST id=ytNBbt565yt4r3err3 [<limit>]
    - get the most recent (up to `<limit>`) messages that have been sent since the given id/time
    - if * is given instead of a specific ID, just the most recent messages with no limit
CHATHISTORY #ircv3 AROUND id=ytNBbt565yt4r3err3 [<limit>]
    - get a number of messages before and after the given id/time

BEFORE and AFTER are for standard pagination

LATEST is for when you're connecting and looking to get the most recent messages, with an optional limit

AROUND is for when you have a given msg/time and you're looking for the ones around that specific msg/time (for example, with Discord-style textual message searching)

Another query that may or may not be be useful to clients:

CHATHISTORY #ircv3 BETWEEN timestamp=YYYY-MM-DDThh:mm:ss.sssZ timestamp=YYYY-MM-DDThh:mm:ss.sssZ <direction> [<limit>]
    - get up to <limit> number of messages between the given ids/times

BETWEEN helps with certain types of searching, as well as helping fill gaps in existing backlog

<direction> is either + or -:

  • +: Start at the oldest, and return messages ascending from there.
  • -: Start at the newest, and return messages descending from there.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.