Interface MessageCommandContext

All Superinterfaces:
dev.sympho.bot_utils.access.AccessContext, dev.sympho.bot_utils.access.AccessValidator, dev.sympho.bot_utils.access.ChannelAccessContext, dev.sympho.bot_utils.access.ChannelAccessValidator, dev.sympho.bot_utils.event.ChannelEventContext, CommandContext, dev.sympho.bot_utils.event.EventContext, dev.sympho.bot_utils.event.MessageBasedContext, dev.sympho.bot_utils.event.MessageCreateEventContext, dev.sympho.bot_utils.event.MessageEventContext, dev.sympho.bot_utils.event.MessageIncludedContext, dev.sympho.bot_utils.event.RepliableContext
All Known Implementing Classes:
MessageContextImpl

public interface MessageCommandContext extends CommandContext, dev.sympho.bot_utils.event.MessageCreateEventContext
The execution context of an command invoked through a message.
Since:
1.0
Version:
1.0
  • Method Summary

    Modifier and Type
    Method
    Description
    Retrieves the raw argument string as it was received, before being split.
    Retrieves the user that called the command as a guild member as provided by the triggering event, if present.
     
    Retrieves the raw arguments received, keyed by the corresponding parameter name.
    Retrieves the raw arguments received before parsing, in the order that they were received.

    Methods inherited from interface dev.sympho.bot_utils.access.AccessContext

    asGuild, isPrivate

    Methods inherited from interface dev.sympho.bot_utils.access.ChannelAccessContext

    asUser

    Methods inherited from interface dev.sympho.bot_utils.event.ChannelEventContext

    belongs, belongs, belongs, belongs, hasAccess, hasAccess, validate, validator

    Methods inherited from interface dev.sympho.bot_utils.event.EventContext

    client, validate

    Methods inherited from interface dev.sympho.bot_utils.event.MessageCreateEventContext

    channelId, event, fetchMessage, guild, guildId, message, messageId, user

    Methods inherited from interface dev.sympho.bot_utils.event.RepliableContext

    replies, reply, reply, reply, reply, reply, reply, reply
  • Method Details

    • channel

      default Mono<MessageChannel> channel()
      Specified by:
      channel in interface dev.sympho.bot_utils.access.ChannelAccessContext
      Specified by:
      channel in interface CommandContext
      Specified by:
      channel in interface dev.sympho.bot_utils.event.MessageBasedContext
      Specified by:
      channel in interface dev.sympho.bot_utils.event.MessageCreateEventContext
    • callerMember

      default @Nullable Member callerMember()
      Description copied from interface: CommandContext
      Retrieves the user that called the command as a guild member as provided by the triggering event, if present.
      Specified by:
      callerMember in interface CommandContext
      Returns:
      The calling user as a guild member, or null if the command was invoked in a private channel.
    • argString

      @Pure String argString()
      Retrieves the raw argument string as it was received, before being split.

      Does not include the command name(s) (see CommandContext.invocation() for that), only the arguments that are later used for rawArgs().

      Returns:
      The received arguments before splitting.
    • rawArgs

      @Pure List<String> rawArgs()
      Retrieves the raw arguments received before parsing, in the order that they were received.
      Returns:
      The raw arguments received. The returned list is unmodifiable.
    • rawArgMap

      @Pure Map<String,String> rawArgMap()
      Retrieves the raw arguments received, keyed by the corresponding parameter name.
      Returns:
      The raw arguments received. The returned map is unmodifiable.