I'm trying to use the sendMessage(String s) method in the TextChannel interface to send a text message in a channel using
public void sendMessage(TextChannel channel, String s) {
channel.sendMessage(s);
}
Whenever I run to run this method on a random text channel, the call to channel.sendMessage sucesfully returns a RestAction object and the bot continues as normal. However, no text message is displayed in the channel. The bot has permissions and everything, but nothing pops up.
I'm not sure if this is related, but when using intellij's debug mode, I saw running the sendMessage method in the TextChannel interface gave this NPE

Any help would be appreciated, thanks!
add a .queue(); for non-blocking or .complete() to return the Message object.
Look into JDAs RestActions for more information.
add a .queue(); for non-blocking or .complete() to return the Message object.
Thanks! Using .complete() worked
Most helpful comment
add a .queue(); for non-blocking or .complete() to return the Message object.
Look into JDAs RestActions for more information.