Exception: DiscordStore::MissingIntentError

Inherits:
Error
  • Object
show all
Defined in:
lib/discord_store/errors.rb

Overview

Searching requires the MESSAGE_CONTENT privileged intent, which Discord grants per application and reviews by hand once a bot is in 100 guilds.

Instance Method Summary collapse

Constructor Details

#initialize(message = nil) ⇒ MissingIntentError

Returns a new instance of MissingIntentError.



112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/discord_store/errors.rb', line 112

def initialize(message = nil)
  super(message || <<~MSG.strip)
    Discord refused the search request. GET /guilds/{id}/messages/search is
    gated on the MESSAGE_CONTENT privileged intent, which is off by default
    and has to be enabled for the application in the Developer Portal, under
    Bot -> Privileged Gateway Intents. Past 100 guilds Discord reviews the
    request by hand, and "I am using it as a database" is not a use case it
    approves.

    Everything else in this library works without the intent. Search is the
    only part that needs it.
  MSG
end