javadiscord / java-discord-api

A wrapper over the discord API to create bots using Java
GNU General Public License v3.0
7 stars 8 forks source link

Fix CreateMessageRequest not being able to send text messages to channel #120

Closed surajkumar closed 1 month ago

surajkumar commented 1 month ago

The following command was failing:

guild.channel()
        .createMessage(new CreateMessageBuilder(message.channelId()).content("Hello World!"))
        .onError(System.err::println)
        .onSuccess(System.out::println);

With the error: {"message": "Cannot send an empty message", "code": 50006}

This was happening because we were trying to send a multi part body for regular text messages. The sending of files needs further testing however for now I have fixed our ability to send regular text messages to channels.

sonarcloud[bot] commented 1 month ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud