Built-in arguments
tip
These can be used anytime with the Args
class, and can be accessed via container.stores.get('arguments')
.
Overriding
If you define an Argument
with the same name as a built-in one, e.g. boolean
, the one you define will
replace the built-in one. This applies to all other stores from the framework and plugins.
To facilitate creating commands and getting your bot running, Sapphire bundles a large set of argument resolvers.
boolean
: Resolves to aboolean
value.channel
: Resolves to aChannel
instance, given a channel name, mention or ID.date
: Resolves to aDate
instance, given a valid date format. For a list of valid date formats see Several ways to create a Date object on MDNdmChannel
: Resolves to aDMChannel
instance, given a DM channel ID or user's ID.emoji
: Resolves to anEmojiObject
. Theid
isnull
for Twemojis.float
/number
: Resolves to any number.guild
: Resolves to aGuild
instance, given ID.guildCategoryChannel
: Resolves to aCategoryChannel
instance, given a category channel name, mention or ID.guildChannel
: Resolves to aGuildChannel
or aThreadChannel
instance, given a channel name, mention or ID.guildNewsChannel
: Resolves to aNewsChannel
instance, given a news channel name, mention or ID.guildNewsThreadChannel
: Resolves to aThreadChannel
instance of typeGUILD_NEWS_THREAD
, given a thread channel name, mention or ID.guildPrivateThreadChannel
: Resolves to aThreadChannel
instance of typeGUILD_PRIVATE_THREAD
, given a thread channel name, mention or ID.guildPublicThreadChannel
: Resolves to aThreadChannel
instance of typeGUILD_PUBLIC_THREAD
, given a thread channel name, mention or ID.guildStageVoiceChannel
: Resolves to aStageChannel
instance, given a stage voice channel name, mention or ID.guildTextChannel
: Resolves to aTextChannel
instance, given a text channel name, mention or ID.guildThreadChannel
: Resolves to aThreadChannel
instance, given a thread channel name, mention or ID.guildVoiceChannel
: Resolves to aVoiceChannel
instance, given a voice channel name, mention or ID.hyperlink
/url
: Resolves to aURL
instance, given a valid URL.integer
: Resolves to a safe integer.member
: Resolves to aGuildMember
instance, given a member name, mention or ID.message
: Resolves to aMessage
instance, given a message link or ID.partialDMChannel
: Resolves to aPartialDMChannel
instance, given a DM channel ID or user's ID.role
: Resolves to aRole
instance, given a role name, mention or ID.string
: Resolves to a string containing the parameter.user
: Resolves to aUser
instance, given a user mention or ID.enum
: Resolves to a string if it occurs within thearray
of possible items that is passed as an option (enum
).