DiscordPHP Documentation

Application

Interfaces, Classes, Traits and Enums

ExtendedPromisorInterface
Expands on the react/promise PromisorInterface by returning an extended promise.
CommandBuilder
Helper class used to build application commands.
ActionRow
An Action Row is a non-interactive container component for other types of components.
Button
Buttons are interactive components that render in messages.
ChannelSelect
Select menu for channels.
Component
Components are a new field on the message object, so you can use them whether you're sending messages or responding to a slash command or other interaction.
MentionableSelect
Select menu for mentionables (users and roles).
Option
Option for select menu component.
RoleSelect
Select menu for roles.
SelectMenu
Select menus are interactive components that allow users to select one or more options from a dropdown list in messages.
StringSelect
Select menu for picking from defined text options.
TextInput
Text inputs are an interactive component that render on modals. They can be used to collect short-form or long-form text.
UserSelect
Select menu for users.
MessageBuilder
Helper class used to build messages.
Command
A message based command that the Command Client will listen for.
Discord
The Discord client class.
DiscordCommandClient
Provides an easy way to have triggerable message based commands.
BufferTimedOutException
Thrown when reading from a buffer times out.
DCANotFoundException
Thrown when DCA could not be found.
FFmpegNotFoundException
Thrown when the FFmpeg binary cannot be found in your PATH.
FileNotFoundException
Thrown when the client cannot find the file that was specified.
IntentException
Thrown when an invalid intent is given.
InvalidOverwriteException
LibSodiumNotFoundException
Thrown when libsodium or libsodium-php cannot be found.
OpusNotFoundException
Thrown when FFmpeg is not compiled with libopus.
OutdatedDCAException
Thrown when the installed DCA version is outdated.
PartRequestFailedException
Thrown when a request that was executed from a part failed.
Factory
Exposes an interface to build part objects without the other requirements.
BigInt
Polyfill to handle big integer operation in 32 bit PHP using ext-gmp.
Buffer
CacheConfig
Cache configuration class. To be used with Discord `cache` Options.
CacheWrapper
Wrapper for CacheInterface that store Repository items.
Collection
Collection of items. Inspired by Laravel Collections.
Deferred
Wrapper for extended promisor interface. Work-around until react/promise v3.0.
Multipart
Builds a multipart request.
RegisteredCommand
RegisteredCommand represents a command that has been registered with the Discord servers and has a handler to handle when the command is triggered.
Attachment
A message attachment.
Channel
A Channel can be either a text or voice channel on a Discord guild.
Reaction
An object that specifies the emoji to use as the default way to react to a forum post. Exactly one of `emoji_id` and `emoji_name` must be set.
Tag
An object that represents a tag that is able to be applied to a thread in a `GUILD_FORUM` channel.
Invite
An invite to a Channel and Guild.
Message
A message which is posted to a Discord text channel.
Overwrite
Channel Overwrite Class.
Reaction
Represents a reaction emoji to a message by members(s).
StageInstance
A Stage Instance holds information about a live stage.
Webhook
Webhooks are a low-effort way to post messages to channels in Discord. They do not require a bot user or authentication to use.
Author
The author of an embed object.
Embed
An embed object to be sent with a message.
Field
A field of an embed object.
Footer
The footer section of an embed.
Image
An image for an embed.
Video
A video for an embed.
AuditLog
Represents an audit log query from a guild.
Entry
Represents an entry in the audit log.
Options
Represents an object of options for different audit log action types.
Action
An action which will execute whenever a rule is triggered.
Rule
Auto Moderation is a feature which allows each guild to set up rules that trigger based on some criteria. For example, a rule can trigger whenever a message contains a specific keyword.
Ban
A Ban is a ban on a user specific to a guild. It is also IP based.
CommandPermissions
Guild Application Command Permissions Class.
Emoji
An emoji object represents a custom emoji.
Guild
A Guild is Discord's equivalent of a server. It contains all the Members, Channels, Roles, Bans etc.
GuildTemplate
A Guild Template is a code that when used, creates a guild based on a snapshot of an existing guild.
Integration
An Integration is a guild integrations for Twitch, Youtube, Bot and Apps.
Role
A role defines permissions for the guild. Members can be added to the role.
ScheduledEvent
A representation of a scheduled event in a guild.
Sticker
A sticker that can be sent in a Discord message.
WelcomeChannel
A Welcome Channel of a Guild.
WelcomeScreen
A Welcome Screen of a Guild.
Widget
A Widget of a Guild.
Choice
Choice represents a choice that can be given to a command.
Command
Represents a command registered on the Discord servers.
Option
Option represents an array of options that can be given to a command.
Permission
Application Command Permissions Class.
Interaction
Represents an interaction from Discord.
Component
Represents a component received with a message or interaction.
InteractionData
Represents the data associated with an interaction.
Option
Represents an option received with an interaction.
Resolved
Represents the data associated with an interaction.
Application
The OAuth2 application of the bot.
Part
This class is the base of all objects that are returned. All "Parts" extend off this base class.
ChannelPermission
Represents a set of permissions for a given channel overwrite.
Permission
Permission represents a set of permissions for a given role or overwrite.
RolePermission
Represents a set of permissions for a given role.
Member
Represents a member that belongs to a thread. Not the same as a user nor a guild member.
Thread
Represents a Discord thread.
Activity
The Activity part describes activities the member is undertaking.
Client
The client is the main interface for the client. Most calls on the main class are forwarded here.
Member
A member is a relationship between a user and a guild. It contains user-to-guild specific data like roles.
User
A user is a general user that is not attached to a guild.
AutoModerationActionExecution
Sent when a rule is triggered and an action is executed (e.g. when a message is blocked).
MessageInteraction
Sent on the message object when the message is a response to an Interaction without an existing message.
MessageReaction
Represents a specific reaction to a message by a specific user.
PresenceUpdate
A PresenceUpdate part is used when the `PRESENCE_UPDATE` event is fired on the WebSocket. It contains information about the users presence such as their status (online/away) and their current game.
TypingStart
A TypingStart part is used when the `TYPING_START` event is fired on the WebSocket. It contains information such as when the event was fired and then channel it was fired in.
VoiceServerUpdate
Tells the client that the voice channel's server has changed.
VoiceStateUpdate
Notifies the client of voice state updates about users.
AbstractRepository
Repositories provide a way to store and update parts on the Discord server.
InviteRepository
Contains invites of a channel.
MessageRepository
Contains messages sent to a channel.
OverwriteRepository
Contains permission overwrites for a channel.
ReactionRepository
Contains reactions on a message.
StageInstanceRepository
Contains a live stage instances channel.
ThreadRepository
Contains threads on a channel.
VoiceMemberRepository
Contains voice states for users in the voice channel.
WebhookMessageRepository
Contains messages sent to a channel from the webhook.
WebhookRepository
Contains webhooks for a channel.
AutoModerationRuleRepository
Contains auto moderation rules for a guild.
BanRepository
Contains bans for users of a guild.
ChannelRepository
Contains channels on a guild.
CommandPermissionsRepository
Contains permission overwrites for application guild commands.
EmojiRepository
Contains emojis of a guild.
GuildCommandRepository
Contains application guild commands.
GuildTemplateRepository
Contains guild templates of a guild.
IntegrationRepository
Contains integrations on a guild.
InviteRepository
Contains invites to a guild.
MemberRepository
Contains members of a guild.
RoleRepository
Contains roles of a guild.
ScheduledEventRepository
Contains scheduled events on a guild.
StickerRepository
Contains stickers of a guild.
GuildRepository
Contains guilds that the client is in.
GlobalCommandRepository
Contains application global commands.
PrivateChannelRepository
Contains private channels and groups that the client has access to.
MemberRepository
Contains members of a thread.
UserRepository
Contains users that the client shares guilds with.
Buffer
A Byte Buffer similar to Buffer in NodeJS.
RecieveStream
Handles recieving audio from Discord.
VoiceClient
The Discord voice client.
VoicePacket
A voice packet received from Discord.
Event
Contains constants for WebSocket events as well as handlers for the events.
ApplicationCommandPermissionsUpdate
Contains constants for WebSocket events as well as handlers for the events.
AutoModerationActionExecution
Contains constants for WebSocket events as well as handlers for the events.
AutoModerationRuleCreate
Contains constants for WebSocket events as well as handlers for the events.
AutoModerationRuleDelete
Contains constants for WebSocket events as well as handlers for the events.
AutoModerationRuleUpdate
Contains constants for WebSocket events as well as handlers for the events.
ChannelCreate
Contains constants for WebSocket events as well as handlers for the events.
ChannelDelete
Contains constants for WebSocket events as well as handlers for the events.
ChannelPinsUpdate
Contains constants for WebSocket events as well as handlers for the events.
ChannelUpdate
Contains constants for WebSocket events as well as handlers for the events.
GuildAuditLogEntryCreate
Contains constants for WebSocket events as well as handlers for the events.
GuildBanAdd
Contains constants for WebSocket events as well as handlers for the events.
GuildBanRemove
Contains constants for WebSocket events as well as handlers for the events.
GuildCreate
Contains constants for WebSocket events as well as handlers for the events.
GuildDelete
Contains constants for WebSocket events as well as handlers for the events.
GuildEmojisUpdate
Contains constants for WebSocket events as well as handlers for the events.
GuildIntegrationsUpdate
Contains constants for WebSocket events as well as handlers for the events.
GuildMemberAdd
Contains constants for WebSocket events as well as handlers for the events.
GuildMemberRemove
Contains constants for WebSocket events as well as handlers for the events.
GuildMemberUpdate
Contains constants for WebSocket events as well as handlers for the events.
GuildRoleCreate
Contains constants for WebSocket events as well as handlers for the events.
GuildRoleDelete
Contains constants for WebSocket events as well as handlers for the events.
GuildRoleUpdate
Contains constants for WebSocket events as well as handlers for the events.
GuildScheduledEventCreate
Contains constants for WebSocket events as well as handlers for the events.
GuildScheduledEventDelete
Contains constants for WebSocket events as well as handlers for the events.
GuildScheduledEventUpdate
Contains constants for WebSocket events as well as handlers for the events.
GuildScheduledEventUserAdd
Contains constants for WebSocket events as well as handlers for the events.
GuildScheduledEventUserRemove
Contains constants for WebSocket events as well as handlers for the events.
GuildStickersUpdate
Contains constants for WebSocket events as well as handlers for the events.
GuildUpdate
Contains constants for WebSocket events as well as handlers for the events.
IntegrationCreate
Contains constants for WebSocket events as well as handlers for the events.
IntegrationDelete
Contains constants for WebSocket events as well as handlers for the events.
IntegrationUpdate
Contains constants for WebSocket events as well as handlers for the events.
InteractionCreate
Contains constants for WebSocket events as well as handlers for the events.
InviteCreate
Contains constants for WebSocket events as well as handlers for the events.
InviteDelete
Contains constants for WebSocket events as well as handlers for the events.
MessageCreate
Contains constants for WebSocket events as well as handlers for the events.
MessageDelete
Contains constants for WebSocket events as well as handlers for the events.
MessageDeleteBulk
Contains constants for WebSocket events as well as handlers for the events.
MessageReactionAdd
Contains constants for WebSocket events as well as handlers for the events.
MessageReactionRemove
Contains constants for WebSocket events as well as handlers for the events.
MessageReactionRemoveAll
Contains constants for WebSocket events as well as handlers for the events.
MessageReactionRemoveEmoji
Contains constants for WebSocket events as well as handlers for the events.
MessageUpdate
Contains constants for WebSocket events as well as handlers for the events.
PresenceUpdate
Contains constants for WebSocket events as well as handlers for the events.
StageInstanceCreate
Contains constants for WebSocket events as well as handlers for the events.
StageInstanceDelete
Contains constants for WebSocket events as well as handlers for the events.
StageInstanceUpdate
Contains constants for WebSocket events as well as handlers for the events.
ThreadCreate
Contains constants for WebSocket events as well as handlers for the events.
ThreadDelete
Contains constants for WebSocket events as well as handlers for the events.
ThreadListSync
Contains constants for WebSocket events as well as handlers for the events.
ThreadMembersUpdate
Contains constants for WebSocket events as well as handlers for the events.
ThreadMemberUpdate
Contains constants for WebSocket events as well as handlers for the events.
ThreadUpdate
Contains constants for WebSocket events as well as handlers for the events.
TypingStart
Contains constants for WebSocket events as well as handlers for the events.
UserUpdate
Contains constants for WebSocket events as well as handlers for the events.
VoiceServerUpdate
Contains constants for WebSocket events as well as handlers for the events.
VoiceStateUpdate
Contains constants for WebSocket events as well as handlers for the events.
WebhooksUpdate
Contains constants for WebSocket events as well as handlers for the events.
Handlers
This class contains all the handlers for the individual WebSocket events.
Intents
Contains constants used in intents.
Op
Contains constants used in websockets.
CommandAttributes
Application Command attributes.

Table of Contents

COLORTABLE  = ['indianred' => 0xcd5c5c, 'lightcoral' => 0xf08080, 'salmon' => 0xfa8072, 'darksalmon' => 0xe9967a, 'lightsalmon' => 0xffa07a, 'crimson' => 0xdc143c, 'red' => 0xff0000, 'firebrick' => 0xb22222, 'darkred' => 0x8b0000, 'pink' => 0xffc0cb, 'lightpink' => 0xffb6c1, 'hotpink' => 0xff69b4, 'deeppink' => 0xff1493, 'mediumvioletred' => 0xc71585, 'palevioletred' => 0xdb7093, 'lightsalmon' => 0xffa07a, 'coral' => 0xff7f50, 'tomato' => 0xff6347, 'orangered' => 0xff4500, 'darkorange' => 0xff8c00, 'orange' => 0xffa500, 'gold' => 0xffd700, 'yellow' => 0xffff00, 'lightyellow' => 0xffffe0, 'lemonchiffon' => 0xfffacd, 'lightgoldenrodyellow' => 0xfafad2, 'papayawhip' => 0xffefd5, 'moccasin' => 0xffe4b5, 'peachpuff' => 0xffdab9, 'palegoldenrod' => 0xeee8aa, 'khaki' => 0xf0e68c, 'darkkhaki' => 0xbdb76b, 'lavender' => 0xe6e6fa, 'thistle' => 0xd8bfd8, 'plum' => 0xdda0dd, 'violet' => 0xee82ee, 'orchid' => 0xda70d6, 'fuchsia' => 0xff00ff, 'magenta' => 0xff00ff, 'mediumorchid' => 0xba55d3, 'mediumpurple' => 0x9370db, 'rebeccapurple' => 0x663399, 'blueviolet' => 0x8a2be2, 'darkviolet' => 0x9400d3, 'darkorchid' => 0x9932cc, 'darkmagenta' => 0x8b008b, 'purple' => 0x800080, 'indigo' => 0x4b0082, 'slateblue' => 0x6a5acd, 'darkslateblue' => 0x483d8b, 'mediumslateblue' => 0x7b68ee, 'greenyellow' => 0xadff2f, 'chartreuse' => 0x7fff00, 'lawngreen' => 0x7cfc00, 'lime' => 0xff00, 'limegreen' => 0x32cd32, 'palegreen' => 0x98fb98, 'lightgreen' => 0x90ee90, 'mediumspringgreen' => 0xfa9a, 'springgreen' => 0xff7f, 'mediumseagreen' => 0x3cb371, 'seagreen' => 0x2e8b57, 'forestgreen' => 0x228b22, 'green' => 0x8000, 'darkgreen' => 0x6400, 'yellowgreen' => 0x9acd32, 'olivedrab' => 0x6b8e23, 'olive' => 0x808000, 'darkolivegreen' => 0x556b2f, 'mediumaquamarine' => 0x66cdaa, 'darkseagreen' => 0x8fbc8b, 'lightseagreen' => 0x20b2aa, 'darkcyan' => 0x8b8b, 'teal' => 0x8080, 'aqua' => 0xffff, 'cyan' => 0xffff, 'lightcyan' => 0xe0ffff, 'paleturquoise' => 0xafeeee, 'aquamarine' => 0x7fffd4, 'turquoise' => 0x40e0d0, 'mediumturquoise' => 0x48d1cc, 'darkturquoise' => 0xced1, 'cadetblue' => 0x5f9ea0, 'steelblue' => 0x4682b4, 'lightsteelblue' => 0xb0c4de, 'powderblue' => 0xb0e0e6, 'lightblue' => 0xadd8e6, 'skyblue' => 0x87ceeb, 'lightskyblue' => 0x87cefa, 'deepskyblue' => 0xbfff, 'dodgerblue' => 0x1e90ff, 'cornflowerblue' => 0x6495ed, 'mediumslateblue' => 0x7b68ee, 'royalblue' => 0x4169e1, 'blue' => 0xff, 'mediumblue' => 0xcd, 'darkblue' => 0x8b, 'navy' => 0x80, 'midnightblue' => 0x191970, 'cornsilk' => 0xfff8dc, 'blanchedalmond' => 0xffebcd, 'bisque' => 0xffe4c4, 'navajowhite' => 0xffdead, 'wheat' => 0xf5deb3, 'burlywood' => 0xdeb887, 'tan' => 0xd2b48c, 'rosybrown' => 0xbc8f8f, 'sandybrown' => 0xf4a460, 'goldenrod' => 0xdaa520, 'darkgoldenrod' => 0xb8860b, 'peru' => 0xcd853f, 'chocolate' => 0xd2691e, 'saddlebrown' => 0x8b4513, 'sienna' => 0xa0522d, 'brown' => 0xa52a2a, 'maroon' => 0x800000, 'white' => 0xffffff, 'snow' => 0xfffafa, 'honeydew' => 0xf0fff0, 'mintcream' => 0xf5fffa, 'azure' => 0xf0ffff, 'aliceblue' => 0xf0f8ff, 'ghostwhite' => 0xf8f8ff, 'whitesmoke' => 0xf5f5f5, 'seashell' => 0xfff5ee, 'beige' => 0xf5f5dc, 'oldlace' => 0xfdf5e6, 'floralwhite' => 0xfffaf0, 'ivory' => 0xfffff0, 'antiquewhite' => 0xfaebd7, 'linen' => 0xfaf0e6, 'lavenderblush' => 0xfff0f5, 'mistyrose' => 0xffe4e1, 'gainsboro' => 0xdcdcdc, 'lightgray' => 0xd3d3d3, 'silver' => 0xc0c0c0, 'darkgray' => 0xa9a9a9, 'gray' => 0x808080, 'dimgray' => 0x696969, 'lightslategray' => 0x778899, 'slategray' => 0x708090, 'darkslategray' => 0x2f4f4f, 'black' => 0x0]
The HTML Color Table.
mentioned()  : bool
Checks to see if a part has been mentioned.
getColor()  : int
Get int value for color.
contains()  : bool
Checks if a string contains an array of phrases.
studly()  : string
Converts a string to studlyCase.
poly_strlen()  : int
Polyfill to check if mbstring is installed.
imageToBase64()  : string
Converts a file to base64 representation.
getSnowflakeTimestamp()  : float
Takes a snowflake and calculates the time that the snowflake was generated.
escapeMarkdown()  : string
Escape various Discord formatting and markdown into a plain text: _Italics_, **Bold**, __Underline__, ~~Strikethrough~~, ||spoiler|| `Code`, ```Code block```, > Quotes, >>> Block quotes #Channel @User A backslash will be added before the each formatting symbol.
deferFind()  : Promise
Run a deferred search in array.
nowait()  : mixed
Attempts to return a resolved value from a synchronous promise.

Constants

COLORTABLE

The HTML Color Table.

public array<string|int, mixed> COLORTABLE = ['indianred' => 0xcd5c5c, 'lightcoral' => 0xf08080, 'salmon' => 0xfa8072, 'darksalmon' => 0xe9967a, 'lightsalmon' => 0xffa07a, 'crimson' => 0xdc143c, 'red' => 0xff0000, 'firebrick' => 0xb22222, 'darkred' => 0x8b0000, 'pink' => 0xffc0cb, 'lightpink' => 0xffb6c1, 'hotpink' => 0xff69b4, 'deeppink' => 0xff1493, 'mediumvioletred' => 0xc71585, 'palevioletred' => 0xdb7093, 'lightsalmon' => 0xffa07a, 'coral' => 0xff7f50, 'tomato' => 0xff6347, 'orangered' => 0xff4500, 'darkorange' => 0xff8c00, 'orange' => 0xffa500, 'gold' => 0xffd700, 'yellow' => 0xffff00, 'lightyellow' => 0xffffe0, 'lemonchiffon' => 0xfffacd, 'lightgoldenrodyellow' => 0xfafad2, 'papayawhip' => 0xffefd5, 'moccasin' => 0xffe4b5, 'peachpuff' => 0xffdab9, 'palegoldenrod' => 0xeee8aa, 'khaki' => 0xf0e68c, 'darkkhaki' => 0xbdb76b, 'lavender' => 0xe6e6fa, 'thistle' => 0xd8bfd8, 'plum' => 0xdda0dd, 'violet' => 0xee82ee, 'orchid' => 0xda70d6, 'fuchsia' => 0xff00ff, 'magenta' => 0xff00ff, 'mediumorchid' => 0xba55d3, 'mediumpurple' => 0x9370db, 'rebeccapurple' => 0x663399, 'blueviolet' => 0x8a2be2, 'darkviolet' => 0x9400d3, 'darkorchid' => 0x9932cc, 'darkmagenta' => 0x8b008b, 'purple' => 0x800080, 'indigo' => 0x4b0082, 'slateblue' => 0x6a5acd, 'darkslateblue' => 0x483d8b, 'mediumslateblue' => 0x7b68ee, 'greenyellow' => 0xadff2f, 'chartreuse' => 0x7fff00, 'lawngreen' => 0x7cfc00, 'lime' => 0xff00, 'limegreen' => 0x32cd32, 'palegreen' => 0x98fb98, 'lightgreen' => 0x90ee90, 'mediumspringgreen' => 0xfa9a, 'springgreen' => 0xff7f, 'mediumseagreen' => 0x3cb371, 'seagreen' => 0x2e8b57, 'forestgreen' => 0x228b22, 'green' => 0x8000, 'darkgreen' => 0x6400, 'yellowgreen' => 0x9acd32, 'olivedrab' => 0x6b8e23, 'olive' => 0x808000, 'darkolivegreen' => 0x556b2f, 'mediumaquamarine' => 0x66cdaa, 'darkseagreen' => 0x8fbc8b, 'lightseagreen' => 0x20b2aa, 'darkcyan' => 0x8b8b, 'teal' => 0x8080, 'aqua' => 0xffff, 'cyan' => 0xffff, 'lightcyan' => 0xe0ffff, 'paleturquoise' => 0xafeeee, 'aquamarine' => 0x7fffd4, 'turquoise' => 0x40e0d0, 'mediumturquoise' => 0x48d1cc, 'darkturquoise' => 0xced1, 'cadetblue' => 0x5f9ea0, 'steelblue' => 0x4682b4, 'lightsteelblue' => 0xb0c4de, 'powderblue' => 0xb0e0e6, 'lightblue' => 0xadd8e6, 'skyblue' => 0x87ceeb, 'lightskyblue' => 0x87cefa, 'deepskyblue' => 0xbfff, 'dodgerblue' => 0x1e90ff, 'cornflowerblue' => 0x6495ed, 'mediumslateblue' => 0x7b68ee, 'royalblue' => 0x4169e1, 'blue' => 0xff, 'mediumblue' => 0xcd, 'darkblue' => 0x8b, 'navy' => 0x80, 'midnightblue' => 0x191970, 'cornsilk' => 0xfff8dc, 'blanchedalmond' => 0xffebcd, 'bisque' => 0xffe4c4, 'navajowhite' => 0xffdead, 'wheat' => 0xf5deb3, 'burlywood' => 0xdeb887, 'tan' => 0xd2b48c, 'rosybrown' => 0xbc8f8f, 'sandybrown' => 0xf4a460, 'goldenrod' => 0xdaa520, 'darkgoldenrod' => 0xb8860b, 'peru' => 0xcd853f, 'chocolate' => 0xd2691e, 'saddlebrown' => 0x8b4513, 'sienna' => 0xa0522d, 'brown' => 0xa52a2a, 'maroon' => 0x800000, 'white' => 0xffffff, 'snow' => 0xfffafa, 'honeydew' => 0xf0fff0, 'mintcream' => 0xf5fffa, 'azure' => 0xf0ffff, 'aliceblue' => 0xf0f8ff, 'ghostwhite' => 0xf8f8ff, 'whitesmoke' => 0xf5f5f5, 'seashell' => 0xfff5ee, 'beige' => 0xf5f5dc, 'oldlace' => 0xfdf5e6, 'floralwhite' => 0xfffaf0, 'ivory' => 0xfffff0, 'antiquewhite' => 0xfaebd7, 'linen' => 0xfaf0e6, 'lavenderblush' => 0xfff0f5, 'mistyrose' => 0xffe4e1, 'gainsboro' => 0xdcdcdc, 'lightgray' => 0xd3d3d3, 'silver' => 0xc0c0c0, 'darkgray' => 0xa9a9a9, 'gray' => 0x808080, 'dimgray' => 0x696969, 'lightslategray' => 0x778899, 'slategray' => 0x708090, 'darkslategray' => 0x2f4f4f, 'black' => 0x0]

HTML Color Table.

Tags
since
5.0.12

Functions

mentioned()

Checks to see if a part has been mentioned.

mentioned(Part|string $part, Message $message) : bool
Parameters
$part : Part|string

The part or mention to look for.

$message : Message

The message to check.

Tags
since
4.0.0
Return values
bool

Whether the part was mentioned.

getColor()

Get int value for color.

getColor(int|string $color) : int
Parameters
$color : int|string

The color's int, hexcode or htmlname.

Tags
since
5.0.12
Return values
int

color

contains()

Checks if a string contains an array of phrases.

contains(string $string, array<string|int, mixed> $matches) : bool
Parameters
$string : string

The string to check.

$matches : array<string|int, mixed>

Array containing one or more phrases to match.

Tags
since
5.0.12
Return values
bool

studly()

Converts a string to studlyCase.

studly(string $string) : string
Parameters
$string : string

The string to convert.

Tags
since
5.0.12
Return values
string

poly_strlen()

Polyfill to check if mbstring is installed.

poly_strlen(string $str) : int
Parameters
$str : string
Tags
since
5.0.12
Return values
int

imageToBase64()

Converts a file to base64 representation.

imageToBase64(string $filepath) : string
Parameters
$filepath : string
Tags
since
5.1.0
Return values
string

getSnowflakeTimestamp()

Takes a snowflake and calculates the time that the snowflake was generated.

getSnowflakeTimestamp(string|float $snowflake) : float
Parameters
$snowflake : string|float
Tags
since
5.1.1
Return values
float

escapeMarkdown()

Escape various Discord formatting and markdown into a plain text: _Italics_, **Bold**, __Underline__, ~~Strikethrough~~, ||spoiler|| `Code`, ```Code block```, > Quotes, >>> Block quotes #Channel @User A backslash will be added before the each formatting symbol.

escapeMarkdown(string $text) : string
Parameters
$text : string
Tags
since
6.0.2
Return values
string

the escaped string unformatted as plain text

deferFind()

Run a deferred search in array.

deferFind(array<string|int, mixed>|object $array, callable $callback[, LoopInterface|null $loop = null ]) : Promise
Parameters
$array : array<string|int, mixed>|object

Traversable, use $collection->getIterator() if searching in Collection

$callback : callable

The filter function to run

$loop : LoopInterface|null = null

Loop interface, use $discord->getLoop()

Tags
since
10.0.0

Handle $canceller internally, use cancel() from the returned promise.

since
7.1.0
Return values
Promise

nowait()

Attempts to return a resolved value from a synchronous promise.

nowait(PromiseInterface $promiseInterface) : mixed

Like await() but only for resolvable blocking promise without touching the loop.

Parameters
$promiseInterface : PromiseInterface

The synchronous promise.

Tags
see
await()

for asynchronous promise.

since
10.0.0
Return values
mixed

null if failed to return.

Search results