Debugging
Debugging c.res* Methods
Section titled “Debugging c.res* Methods”c.res, c.resModal, c.resAutocomplete
return c.resModal(modal, async res => { const log = await inspectResponse(res) console.log(log.text)})Pass a callback function as the final argument to a c.res* method to use callback mode.
In callback mode, you can inspect the Response returned by the Discord API, making it easier to identify issues with your response.
Debugging c.followup
Section titled “Debugging c.followup”return c.resDefer(async c => { const res = await c.followup(data) const log = await inspectResponse(res) console.log(log.text)})With c.followup, you can inspect the returned Response directly.