44import de .btobastian .sdcf4j .CommandExecutor ;
55import org .javacord .api .DiscordApi ;
66import org .javacord .api .entity .channel .TextChannel ;
7+ import org .javacord .api .entity .message .Message ;
78import org .javacord .api .entity .message .embed .EmbedBuilder ;
89import org .javacord .api .util .logging .ExceptionLogger ;
910import org .javacord .bot .Constants ;
11+ import org .javacord .bot .listeners .CommandCleanupListener ;
1012import org .javacord .bot .util .javadoc .parser .JavadocClass ;
1113import org .javacord .bot .util .javadoc .parser .JavadocMethod ;
1214import org .javacord .bot .util .javadoc .parser .JavadocParser ;
@@ -32,10 +34,12 @@ public class DocsCommand implements CommandExecutor {
3234 * The parameters that indicate searching for class names only.
3335 */
3436 private static final Set <String > classParams = new HashSet <>(Arrays .asList ("classes" , "class" , "c" ));
37+
3538 /**
3639 * The parameters that indicate searching for method names only.
3740 */
3841 private static final Set <String > methodParams = new HashSet <>(Arrays .asList ("methods" , "method" , "m" ));
42+
3943 /**
4044 * The parameters that indicate also searching internal packages and the core docs.
4145 */
@@ -45,11 +49,12 @@ public class DocsCommand implements CommandExecutor {
4549 * Executes the {@code !docs} command.
4650 *
4751 * @param channel The channel where the command was issued.
52+ * @param message The message the command was issued in.
4853 * @param args The arguments given to the command.
4954 * @throws IOException If the Javacord icon stream cannot be closed properly.
5055 */
5156 @ Command (aliases = {"!docs" }, async = true )
52- public void onCommand (TextChannel channel , String [] args ) throws IOException {
57+ public void onCommand (TextChannel channel , Message message , String [] args ) throws IOException {
5358 try (InputStream javacord3Icon = getClass ().getClassLoader ().getResourceAsStream ("javacord3_icon.png" )) {
5459 EmbedBuilder embed = new EmbedBuilder ()
5560 .setThumbnail (javacord3Icon , "png" )
@@ -76,6 +81,7 @@ public void onCommand(TextChannel channel, String[] args) throws IOException {
7681 populateMethods (channel .getApi (), embed , searchString , searchAll );
7782 }
7883 }
84+ CommandCleanupListener .insertResponseTracker (embed , message .getId ());
7985 channel .sendMessage (embed ).join ();
8086 } catch (Throwable t ) {
8187 channel .sendMessage (
0 commit comments