LabyMod / LabyMod/discord-webhook

[FEATURE] Fluent msg/embed builder interface

Open
#12 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

new feature
Dominant language
PHP
Stars
11
Forks
5
PR merge metrics
No merged PRs in 30d

Description

Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? yes

Add a fluent interface to build messages/embeds. Similar to the symfony config-definition builder.

The benefit would be that you can better see how the messages would look like when they're being sent and it makes building complex embeds easier (and cooler) I guess.

Could look something like this:

$builder = new WebhookBuilder();
$builder
    ->embeds()
        ->embed()
            ->title('embed ONE title')
            ->timestamp(new \DateTime())
            ->fields()
                ->field()
                    ->name('field title')
                    ->value('some field value')
                ->end()
            ->end()
        ->end()
        ->embed()
            ->title('embed TWO title')
            ->author()
                ->name('scrummer')
                ->iconUrl('https://my.icon.url/icon.jpg')
            ->end()
        -> end()
    ->end()
;

$builder->send();

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by comparing the requested PHP WebhookBuilder shape with the Symfony config-definition builder linked in the issue, then identify the existing message and embed API it must integrate with. Done means a documented fluent builder can construct the illustrated nested messages and embeds and send them through the webhook.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.