Skip to content

[docs] Work on embeds Guide #7498

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 9 commits into
base: docs/guide
Choose a base branch
from

Conversation

NCPlayz
Copy link
Contributor

@NCPlayz NCPlayz commented Mar 6, 2022

Summary

work on embeds guide

Checklist

  • This PR is not a code change (e.g. documentation, README, ...)

@Rapptz Rapptz added the guide This relates to the discord.py guide label Mar 9, 2022
@Rapptz Rapptz mentioned this pull request Mar 12, 2022
23 tasks

Embeds are a fundamental part of Discord's message format.

They allow you to embed rich content into your messages.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably elaborate on what we mean by "rich content".


The :class:`Embed` class allows usage of the `factory` pattern.

.. hint::
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels kind of silly to directive this as a hint when, without it, this section is only one sentence long.

Next, we need to call :meth:`my_weather_embed.set_thumbnail() <Embed.set_thumbnail>` to set the thumbnail.
To refer to our attachment for the thumbnail, we will use a special URI scheme that Discord provides - ``attachment://``.

Since we called our file ``thumbnail.png``, we will set the ``url`` parameter to ``attachment://thumbnail.png``.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit conflicted on whether we should explain some of the nuances of attachment:// or not.
Filenames get pivoted by Discord before they get attached to this protocol (e.g. my image.png becomes attachment://my_image.png) so maybe it's worth touching on it? Might be kind of out of the scope, but I also don't know where else we would bring this up.

I have a page dedicated to [`C++ Tutorials`](https://rapptz.github.io/cpptuts)!
"""

.. image:: /images/guide/topics/embeds/hyperlink_tooltip_description_embed.png
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tiny tooltip! I know this is sort of inevitable since we're doing high quality screenshots, but it might even be worth photoshopping the tooltip to be larger so it looks a little less weird.

@jelni
Copy link
Contributor

jelni commented Mar 17, 2022

It appears these embed screenshots include a small client bug (that is fixed now). It makes the bottom margin too large:

image

It was caused by the client adding an empty embedFields div

image

Copy link
Contributor

@AbstractUmbra AbstractUmbra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

Comment on lines +6 to +8
.. todo
- cover footer
- cover timestamp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move ur ass

In the Discord client, each row of fields can contain a maximum of 3 fields.

If you wanted to, you could try using the ``inline`` keyword-only argument of :meth:`~Embed.add_field`.
This determines the positioning of the field within the embed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it's worth mentioning that inline actually controls the format of the next field.
If field 0 set's inline to False, then field 1 will appear on a new line, and so on.

@NCPlayz NCPlayz force-pushed the docs/guides/topics/embeds branch from 7413ed6 to c2fbd98 Compare April 12, 2022 00:58
@Soheab Soheab mentioned this pull request Jan 13, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guide This relates to the discord.py guide
Projects
Development

Successfully merging this pull request may close these issues.

5 participants