Available on crate feature
utils
only.Expand description
A set of utilities to help with common use cases that are not required to fully use the library.
Modules§
- Utilities to parse and validate Discord tokens.
Structs§
- Describes formatting on string content
- ContentSafeOptions
cache
Struct that allows to altercontent_safe
’s behaviour. - CreateQuickModal
collector
Convenience builder to create a modal, wait for the user to submit and parse the response. - Represents a combination of a timestamp and a style for formatting time in messages.
- An error that can occur when parsing a
FormattedTimestamp
from a string. - The Message Builder is an ergonomic utility to easily build a message, by adding text and mentioning mentionable structs.
- QuickModalResponse
collector
Enums§
- ChannelParseError
client
Error that can be returned fromChannel::convert
. - Formatting modifiers for MessageBuilder content pushes
- EmojiParseError
client
Error that can be returned fromEmoji::convert
. - Enum representing various styles for formatting time in messages.
- GuildChannelParseError
client
Error that can be returned fromGuildChannel::convert
. - GuildParseError
cache
andclient
Error that can be returned fromGuild::convert
. - MemberParseError
client
Error that can be returned fromMember::convert
. - MessageParseError
client
Error that can be returned fromMessage::convert
. - RoleParseError
client
Error that can be returned fromRole::convert
. - UserParseError
client
Error that can be returned fromUser::convert
.
Traits§
- ArgumentConvert
client
Parse a value from a string in context of a received message. - A trait with additional functionality over the
MessageBuilder
for creating content with additional functionality available only in embeds.
Functions§
- content_safe
cache
Transforms role, channel, user,@everyone
and@here
mentions into raw text by using theCache
and the users passed in withusers
. - parse_channelDeprecated
- Retrieves an Id from a channel mention.
- Retrieves the animated state, name and Id from an emoji mention, in the form of an
EmojiIdentifier
. - Retrieves the “code” part of an invite out of a URL.
- parse_message_id_pair
client
Retrieves IDs from “{channel ID}-{message ID}” (retrieved by shift-clicking on “Copy ID”). - parse_message_url
client
Retrieves guild, channel, and message ID from a message URL. - Turns a string into a vector of string arguments, splitting by spaces, but parsing content within quotes as one individual argument.
- parse_roleDeprecated
- Retrieves an Id from a role mention.
- Retrieves an Id from a user mention.
- Retrieves the username and discriminator out of a user tag (
name#discrim
). In order to accomodate next gen Discord usernames, this will also acceptname
style tags. - parse_usernameDeprecated
- Calculates the Id of the shard responsible for a guild, given its Id and total number of shards used.
- Validates that a token is likely in a valid format.