Disallow sending an empty message
It would be ignored by the offical apps anyway
This commit is contained in:
parent
4120630309
commit
2c586266ff
@ -170,6 +170,11 @@ public class SendCommand implements JsonRpcLocalCommand {
|
||||
previews = List.of();
|
||||
}
|
||||
|
||||
if (messageText.isEmpty() && attachments.isEmpty() && sticker == null && quote == null) {
|
||||
throw new UserErrorException(
|
||||
"Sending empty message is not allowed, either a message, attachment or sticker must be given.");
|
||||
}
|
||||
|
||||
try {
|
||||
var results = m.sendMessage(new Message(messageText,
|
||||
attachments,
|
||||
|
Loading…
x
Reference in New Issue
Block a user