Skip to content

Support X-Audit-Log-Reason for requests that support it #227

@yutotakano

Description

@yutotakano

Discord has now moved to use X-Audit-Log-Reason as the preferred way for bots to provide audit log reasons for certain actions around guilds and channels. There are quite a lot of endpoints that support this.

Two ideas are:

  1. Add an optional field for reason in the body of every HTTP endpoint, and move it into a HTTP header within restCall
  2. Create some generic modifier function like restCall $ AuditLogReason "bad user" $ CreateGuildBan opts etc...

Certain endpoints will need to be updated if we already have an existing reason field from the JSON body. For example, CreateGuildBanOpts currently takes a reason field, and sends it to Discord, but it's not clear if Discord actually uses this since the field has now been removed from their docs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions