Interface ChannelAccessContext

All Superinterfaces:
AccessContext
All Known Subinterfaces:
ApplicationCommandEventContext, ButtonEventContext, ChannelEventContext, ComponentEventContext, DeferrableInteractionEventContext, InteractionEventContext, MessageBasedContext, MessageCreateEventContext, MessageEventContext, MessageIncludedContext, ModalEventContext, RepliableContext, SlashCommandEventContext
All Known Implementing Classes:
AbstractChannelEventContext, AbstractRepliableContext

public interface ChannelAccessContext extends AccessContext
Access context that is specific to a channel.
Since:
1.0
Version:
1.0
Implementation Requirements:
A context must be effectively constant; that is, an implementation of this interface must always return the same value on methods that return a direct value (such as AccessContext.user() or AccessContext.guildId()). Methods that fetch remote resources (i.e. that return a Mono) may return different objects over time (as the remote object is modified), but must always reference the same entity.
  • Method Details

    • channel

      @SideEffectFree Mono<? extends Channel> channel()
      Retrieves the channel.
      Returns:
      The channel.
    • channelId

      @Pure Snowflake channelId()
      Retrieves the ID of the channel.
      Returns:
      The channel's ID.
    • asUser

      default ChannelAccessContext asUser(User user)
      Creates a copy of this context with the user replaced by the given user.

      All associated values are also replaced accordingly.

      Specified by:
      asUser in interface AccessContext
      Parameters:
      user - The target user.
      Returns:
      The new context.