Guild Message Event
Interaction event for guild message context commands.
This event is guaranteed to be run in guilds only, thus getters of guild entities will never return null
.
Localization
You can send localized replies using the user, guild and also any Locale, by using this event directly, but also the interaction hook, see LocalizableInteraction for more details and configuration.
An alternative to using this event is injecting an AppLocalizationContext in a parameter, or retrieving one using getLocalizationContext.
In both cases, you can configure the user and guild locales, using UserLocaleProvider and GuildLocaleProvider.
Rate limit cancellation
Although it is recommended to reject commands using ApplicationCommandFilter, you can also return the bucket token with cancelRateLimit if you want to avoid consuming bandwidth in certain conditions.
Properties
Gets the interaction user as an InputUser.
If set, forces the specified localization bundle to be used.
If set, adds the specified prefix to the path of every localization call, useful to avoid using very long strings in every reply/edit.
Functions
Cancels the token consumption of the current rate limited interaction.
Retrieves a DefaultMessages instance, using a locale suitable for messages sent to the user.
Returns the localized message at the following path, using the guild's locale and parameters.
Returns the localized message at the following path, using the guild's locale and parameters.
Returns a localization context for the provided bundle name and path prefix, using the locales from UserLocaleProvider.getDiscordLocale and GuildLocaleProvider.getDiscordLocale.
Returns the localized message at the following path, using the provided locale and parameters.
Returns the localized message at the following path, using the provided locale and parameters.
Returns the localized message at the following path, using the user's locale and parameters.
Returns the localized message at the following path, using the user's locale and parameters.
Always true
for this guild-only event.
Replies with the localized message at the following path, using the guild's locale and provided parameters.
Replies with the localized message at the following path, using the guild's locale and provided parameters.
Replies with the localized message at the following path, using the provided locale and parameters.
Replies with the localized message at the following path, using the provided locale and parameters.
Replies a localized message to this interaction and acknowledges it.
Replies with the localized message at the following path, using the provided locale and parameters.
Replies a localized ephemeral message to this interaction and acknowledges it.
Replies with the localized message at the following path, using the user's locale and provided parameters.
Replies with the localized message at the following path, using the user's locale and provided parameters.