Expand description
A set of utilities to help with common use cases that are not required to fully use the library.
Modules§
- token
- Utilities to parse and validate Discord tokens.
Structs§
- Content
- Describes formatting on string content
- Content
Safe Options - Struct that allows to alter
content_safe’s behaviour. - Create
Quick Modal - Convenience builder to create a modal, wait for the user to submit and parse the response.
- Custom
Message - A builder for constructing a personal
Messageinstance. - Formatted
Timestamp - Represents a combination of a timestamp and a style for formatting time in messages.
- Formatted
Timestamp Parse Error - An error that can occur when parsing a
FormattedTimestampfrom a string. - Message
Builder - The Message Builder is an ergonomic utility to easily build a message, by adding text and mentioning mentionable structs.
- Quick
Modal Response
Enums§
- Channel
Parse Error - Error that can be returned from
Channel::convert. - Content
Modifier - Formatting modifiers for MessageBuilder content pushes
- Emoji
Parse Error - Error that can be returned from
Emoji::convert. - Formatted
Timestamp Style - Enum representing various styles for formatting time in messages.
- Guild
Channel Parse Error - Error that can be returned from
GuildChannel::convert. - Guild
Parse Error - Error that can be returned from
Guild::convert. - Member
Parse Error - Error that can be returned from
Member::convert. - Message
Parse Error - Error that can be returned from
Message::convert. - Role
Parse Error - Error that can be returned from
Role::convert. - User
Parse Error - Error that can be returned from
User::convert.
Traits§
- Argument
Convert - Parse a value from a string in context of a received message.
- Embed
Message Building - A trait with additional functionality over the
MessageBuilderfor creating content with additional functionality available only in embeds.
Functions§
- content_
safe - Transforms role, channel, user,
@everyoneand@herementions into raw text by using theCacheand the users passed in withusers. - parse_
channel Deprecated - parse_
channel_ mention - Retrieves an Id from a channel mention.
- parse_
emoji - Retrieves the animated state, name and Id from an emoji mention, in the form of an
EmojiIdentifier. - parse_
invite - Retrieves the “code” part of an invite out of a URL.
- parse_
message_ id_ pair - Retrieves IDs from “{channel ID}-{message ID}” (retrieved by shift-clicking on “Copy ID”).
- parse_
message_ url - Retrieves guild, channel, and message ID from a message URL.
- parse_
quotes - Turns a string into a vector of string arguments, splitting by spaces, but parsing content within quotes as one individual argument.
- parse_
role Deprecated - parse_
role_ mention - Retrieves an Id from a role mention.
- parse_
user_ mention - Retrieves an Id from a user mention.
- parse_
user_ tag - Retrieves the username and discriminator out of a user tag (
name#discrim). In order to accomodate next gen Discord usernames, this will also acceptnamestyle tags. - parse_
username Deprecated - parse_
webhook - Parses the id and token from a webhook url. Expects a
url::Urlrather than a&str. - shard_
id - Calculates the Id of the shard responsible for a guild, given its Id and total number of shards used.
- validate_
token - Validates that a token is likely in a valid format.