DaRealTurtyWurty / SuperTurtyBot

A multi-purpose discord bot.
GNU Affero General Public License v3.0
6 stars 10 forks source link

Switch event.deferReply().setContent to reply(event, ....) #207

Closed DaRealTurtyWurty closed 9 months ago

DaRealTurtyWurty commented 9 months ago

A lot of the code was written before I added the reply method, and as such it is using event.deferReply().setContent, which is a lot more of a handful.

So, ideally, at some point it would be nice to switch all of the code to be using the reply method in order to keep some consistency throughout.

All instances should be visible here: https://github.com/search?q=repo%3ADaRealTurtyWurty%2FSuperTurtyBot%20event.deferReply&type=code

However, it is important to note that instances of event.deferReply().queue() and event.deferReply(true).queue() should be left alone.

AlessioBugetti commented 9 months ago

I am interested in addressing this issue and would appreciate being assigned to it.

There are some cases that seem unable to be replaced using the reply method, such as:

event.deferReply().setFiles(FileUpload.fromData(connection.getInputStream(), statusCode + ".jpg"))

In these cases, is it sufficient to leave event.deferReply left alone?

DaRealTurtyWurty commented 9 months ago

In these cases, is it sufficient to leave event.deferReply left alone?

Yes, in those circumstances, it would be fine to leave it as-is.