Skip to content

/remind doesnt work in threads (NPE) #405

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Zabuzard opened this issue Mar 2, 2022 · 5 comments · Fixed by #422
Closed

/remind doesnt work in threads (NPE) #405

Zabuzard opened this issue Mar 2, 2022 · 5 comments · Fixed by #422
Assignees
Labels
bug Something isn't working enhance command Modify or improve an existing command or group of commands of the bot good first issue Good for newcomers priority: normal

Comments

@Zabuzard
Copy link
Member

Zabuzard commented Mar 2, 2022

Overview

The /remind command can not send a reminder that was set off from within a Discord-Thread. Worse, it crashes with a NPE:

log

Proposed action

First of all, it is important to get rid of the error.

Either, we find a way to make it work inside threads (maybe there are some sort of thread ids?), or we just actively try to detect whether it is inside a thread (e.g. the thing is null, as the error says) and respond with something like "sorry, can not remind you from within a thread".

@Zabuzard Zabuzard added bug Something isn't working good first issue Good for newcomers enhance command Modify or improve an existing command or group of commands of the bot priority: normal labels Mar 2, 2022
@Zabuzard Zabuzard added this to the Migrate existing commands milestone Mar 2, 2022
@Tais993
Copy link
Member

Tais993 commented Mar 3, 2022

It is possible, but I've to look into specifics before I can explain.
So if anyone is interested in fixing this, either @ me or try it yourself :p

We need to get the ID from the channel (which is possible iirc)
After this, if the channel isn't found when sending the reminder, we have to manually send a request (using JDA internals; Route)

@Tais993
Copy link
Member

Tais993 commented Mar 29, 2022

With #420 (funny number) being implemented, this shouldn't be an issue anymore.
Once released and tested this can be closed

@Zabuzard
Copy link
Member Author

@Tais993 Is it autofixed, or do we have to do minor adjustments in the code still?

@Tais993
Copy link
Member

Tais993 commented Mar 29, 2022

Should be auto-fixed (but gotta verify that)

@Tais993
Copy link
Member

Tais993 commented Mar 29, 2022

Unfortunately it's not auto-fixed, should've looked at that when reviewing our code.
#422 changes the type from TextChannel to MessageChannel, this fixes that issue and after merge it'll be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhance command Modify or improve an existing command or group of commands of the bot good first issue Good for newcomers priority: normal
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants