Java-Discord / JavaBot

General utility bot for the Discord Java Community
https://discordjug.net/
GNU General Public License v3.0
48 stars 22 forks source link

fix closing of help posts #466

Closed danthe1st closed 10 months ago

danthe1st commented 10 months ago

A JDA update from 5.0.0.beta.15 to 5.0.0.beta.18 caused a regression resulting in the deleting the message of the Close post and Cancel Closing buttons throw an exception as these were deleting the message before acknowledging the interaction.

This PR uses deferEdit() for the Cancel Closing button and closes the help post (including closing and locking the forum post) which acknowledges the interaction before deleting the message with the button.

This issue is described in https://github.com/discord-jda/JDA/issues/2590.