GitHub

DiscordPostOptions

API reference for DiscordPostOptions.

Discord options for every write inside an effect; None leaves a field as the enclosing options set it.

  • notify_users, notify_roles, notify_everyone and notify_replied_user: who a write may notify. Default: nobody, and a reply does not ping its author. notify_everyone allows @everyone and @here.
  • suppress_embeds: default true, which sends the SUPPRESS_EMBEDS flag on the post and on every edit, so a link a later edit adds gets no embed either. False sends no flag on a post and clears it on an edit.
  • fail_if_not_exists: what a post with reply_to does when that message is gone. Default true: Discord refuses the post. False sends fail_if_not_exists: false, and Discord posts the message without the reference.
  • auto_archive_duration: for start_thread, in minutes. Default: the channel's.

Attributes

AttributeTypeDescription
notify_usersSequence[str] | None = None
notify_rolesSequence[str] | None = None
notify_everyonebool | None = None
notify_replied_userbool | None = None
suppress_embedsbool | None = None
fail_if_not_existsbool | None = None
auto_archive_durationAutoArchiveDuration | None = None

Functions

__init__

__init__(*, notify_users=None, notify_roles=None, notify_everyone=None, notify_replied_user=None, suppress_embeds=None, fail_if_not_exists=None, auto_archive_duration=None) -> None
ParameterTypeDescription
notify_usersSequence[str] | None = None
notify_rolesSequence[str] | None = None
notify_everyonebool | None = None
notify_replied_userbool | None = None
suppress_embedsbool | None = None
fail_if_not_existsbool | None = None
auto_archive_durationAutoArchiveDuration | None = None

merge

merge(inner) -> DiscordPostOptions

These options with inner's set fields winning.

ParameterTypeDescription
innerDiscordPostOptions

Returns DiscordPostOptions

def merge(self, inner: DiscordPostOptions) -> DiscordPostOptions:
    """These options with ``inner``'s set fields winning."""
    changes: dict[str, object] = {
        field.name: value
        for field in fields(inner)
        if (value := getattr(inner, field.name)) is not None
    }
    return replace(self, **changes)