Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Discord Php Laravel Package

team-reflex/discord-php

DiscordPHP is a PHP wrapper for Discord’s REST, gateway, and voice APIs. Build Discord bots that run in CLI with ReactPHP-style async handling. Includes limited docs/class reference and community integrations like Laracord for Laravel.

View on GitHub
Deep Wiki
Context7

title: "User"

User represents a user of Discord. The bot can "see" any users that to a guild that they also belong to.

Properties

name type description
id string id of the user
username string username of the user
discriminator string four-digit discriminator of the user
displayname string username#discriminator
avatar string avatar URL of the user
avatar_hash string avatar hash of the user
bot bool whether the user is a bot
system bool whetehr the user is a system user e.g. Clyde
mfa_enabled bool whether the user has multifactor authentication enabled
banner ?string the banner URL of the user.
banner_hash ?string the banner URL of the user.
accent_color ?int the user's banner color encoded as an integer representation
locale ?string locale of the user
verified bool whether the user is verified
email ?string email of the user
flags ?int user flags, see the User classes constants. use bit masks to compare
premium_type ?int type of nitro, see the User classes constants
public_flags ?int see flags above

Get private channel for user

Gets the private direct message channel for the user. Returns a Channel in a promise.

$user->getPrivateChannel()->then(function (Channel $channel) {
    // ...
});

Send user a message

Sends a private direct message to the user. Note that your bot account can be suspended for doing this, consult Discord documentation for more information. Returns the message in a promise.

Parameters

name type description
message string content to send
tts bool whether to send the message as text to speech
embed Embed embed to send in the message
$user->sendMessage('Hello, world!', false, $embed)->then(function (Message $message) {
    // ...
});

Get avatar URL

Gets the avatar URL for the user. Only call this function if you need to change the format or size of the image, otherwise use $user->avatar. Returns a string.

Parameters

name type description
format string format of the image, one of png, jpg or webp, default webp or gif if animated
size int size of the image, default 1024
$url = $user->getAvatarAttribute('png', 2048);
echo $url; // https://cdn.discordapp.com/avatars/:user_id/:avatar_hash.png?size=2048

Get banner URL

Gets the banner URL for the user. Only call this function if you need to change the format or size of the image, otherwise use $user->banner. Returns a string or null if user has no banner image set.

Parameters

name type description
format string format of the image, one of png, jpg or webp, default png or gif if animated
size int size of the image, default 600
$url = $user->getBannerAttribute('png', 1024);
echo $url; // https://cdn.discordapp.com/banners/:user_id/:banner_hash.png?size=1024
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai