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: "Repositories"

Repositories are containers for parts. They provide the functions to get, save and delete parts from the Discord servers. Different parts have many repositories.

An example is the Channel part. It has 4 repositories: members, messages, overwrites and webhooks. Each of these repositories contain parts that relate to the Channel part, such as messages sent in the channel (messages repository), or if it is a voice channel the members currently in the channel (members repository).

A full list of repositories is provided below in the parts section, per part.

Repositories extend the Collection class. See the documentation on collections for extra methods.

Examples provided below are based on the guilds repository in the Discord client.

Methods

All repositories extend the AbstractRepository class, and share a set of core methods.

Freshening the repository data

Clears the repository and fills it with new data from Discord. It takes no parameters and returns the repository in a promise.

$discord->guilds->freshen()->then(function (GuildRepository $guilds) {
    // ...
});

Creating a part

Creates a repository part from an array of attributes and returns the part. Does not create the part in Discord servers, you must use the ->save() function later.

name type description
attributes array Array of attributes to fill in the part. Optional
$guild = $discord->guilds->create([
    'name' => 'My new guild name',
]);
// to save
$discord->guilds->save($guild)->then(...);

Saving a part

Creates or updates a repository part in the Discord servers. Takes a part and returns the same part in a promise.

name type description
part Part The part to create or update
$discord->guilds->save($guild)->then(function (Guild $guild) {
    // ...
});

Deleting a part

Deletes a repository part from the Discord servers. Takes a part and returns the old part in a promise.

name type description
part Part The part to delete
$discord->guilds->delete($guild)->then(function (Guild $guild) {
    // ...
});

Fetch a part

Fetches/freshens a part from the repository. If the part is present in the cache, it returns the cached version, otherwise it retrieves the part from Discord servers. Takes a part ID and returns the part in a promise.

name type description
id string Part ID
fresh bool Forces the method to skip checking the cache. Default is false
$discord->guilds->fetch('guild_id')->then(function (Guild $guild) {
    // ...
});
// or, if you don't want to check the cache
$discord->guilds->fetch('guild_id', true)->then(function (Guild $guild) {
    // ...
});
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