Skip to content

[Bug] Reason parameter is not escaped properly #1073

Description

@youFailerEXE

normal behavior
Any string put inside the reason parameter for a punishment should be delivered through the webhook to discord

Observed/Actual behavior
When using quotation marks inside of the reason parameter for a punishment, an error like this is shown if discord webhooks are turned on:
[13:56:47 WARN]: [BanManager] Failed to send webhook 'webhook-0'
[13:56:47 WARN]: [BanManager] Response code: 400
[13:56:47 WARN]: [BanManager] Response body: {"message": "The request body contains invalid JSON.", "code": 50109}

Steps/models to reproduce

  1. Turn on discord webhooks in webhooks.yml
  2. run a punishment command that contains quotation marks, such as warn youFailer_exe "test"
  3. the error will show up

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions