Searching Messages

One or more of the following search terms may be combined to search for specific messages.

  • IMPORTANT on large databases, certain queries may take minutes to complete.
Search termDescription
text:TEXTSearch for TEXT. This query can be extremely slow on large servers and can timeout without returning any results.
from:USERSearch for messages from USER. USER may be a numeric Discord ID or the Discord user name.
before:DATESearch for messages posted earlier than DATE. See date localization.
during:DATESearch for messages posted on the day specified by DATE. See date localization.
after:DATESearch for messages posted after the specified DATE. See date localization.
has:MEDIASearch for messages with the corresponding media type, where MEDIA is link, embed, or file.
in:CHANNELSearch for messages in CHANNEL.
deletedby:WHOSearch for deleted messages, where WHO is self, mod, bot, or all.
messageid:MESSAGEIDSearch for the message identified by MESSAGEID.
and:AND the search terms together. This is the default. Example: after:Jan 1, 2020 and: before: Mar 31, 2020
or:OR the search terms together. Example: from:alice or: from:bob
order:reverseSort results in reverse order.

Partial date matches

Partial date matches will select the smallest matching date. Examples:

  • 2020 will match the date January 1, 2020.
  • March 2021 will match the date March 1, 2021.

Security

Searching messages requires that the Bot user has the ‘View message logs’ authority.

See also

Was this page helpful?