Fixed /github-search command failing in some cases by Zabuzard · Pull Request #1435 · Together-Java/TJ-Bot
What looks inoccent in the code reference.findIssue(...) is actually running API queries in the background. So it is not a quick command.
The code apparently overlooked this and did not make use of JDAs event.deferReply().queue(). In many cases this then leads to the action crashing because it takes longer than 3 seconds:
This fixes the code by properly using deferReply and then responding through the InteractionHook.
While at it, the PR also fixes a bug with the code in the edge case that the configured GitHub repos have no issues yet (or more commonly when a githubApiKey has not been set up yet). In this case the autocompletion code crashed because it was supplying an empty list. This is now fixed by supplying no issues found in that edge case.
