#[arg(short = 'a', long)]
attachment: Vec<String>,
+ #[arg(long)]
+ view_once: bool,
+
#[arg(long)]
mention: Vec<String>,
endSession: bool,
message: String,
attachments: Vec<String>,
+ view_once: bool,
mentions: Vec<String>,
textStyle: Vec<String>,
quoteTimestamp: Option<u64>,
end_session,
message,
attachment,
+ view_once,
mention,
text_style,
quote_timestamp,
end_session,
message.unwrap_or_default(),
attachment,
+ view_once,
mention,
text_style,
quote_timestamp,
public record Message(
String messageText,
List<String> attachments,
+ boolean viewOnce,
List<Mention> mentions,
Optional<Quote> quote,
Optional<Sticker> sticker,
} else if (!additionalAttachments.isEmpty()) {
messageBuilder.withAttachments(additionalAttachments);
}
+ messageBuilder.withViewOnce(message.viewOnce());
if (!message.mentions().isEmpty()) {
messageBuilder.withMentions(resolveMentions(message.mentions()));
}
Additionally a file name can be added:
e.g.: `data:<MIME-TYPE>;filename=<FILENAME>;base64,<BASE64 ENCODED DATA>`
+*--view-once*::
+Send the message as a view once message.
+A conformant client will only allow the receiver to view the message once.
+View Once is only supported for messages that include an image attachment.
+
*--sticker* STICKER::
Send a sticker of a locally known sticker pack (syntax: stickerPackId:stickerId).
Shouldn't be used together with `-m` as the official clients don't support this.
.help("Add an attachment. "
+ "Can be either a file path or a data URI. Data URI encoded attachments must follow the RFC 2397. Additionally a file name can be added, e.g. "
+ "data:<MIME-TYPE>;filename=<FILENAME>;base64,<BASE64 ENCODED DATA>.");
+ subparser.addArgument("--view-once")
+ .action(Arguments.storeTrue())
+ .help("Send the message as a view once message");
subparser.addArgument("-e", "--end-session", "--endsession")
.help("Clear session state and send end session message.")
.action(Arguments.storeTrue());
if (attachments == null) {
attachments = List.of();
}
+ final var viewOnce = ns.getBoolean("view-once");
final var selfNumber = m.getSelfNumber();
try {
final var message = new Message(messageText,
attachments,
+ viewOnce,
mentions,
Optional.ofNullable(quote),
Optional.ofNullable(sticker),
try {
final var message = new Message(messageText,
attachments,
+ false,
List.of(),
Optional.empty(),
Optional.empty(),
try {
final var message = new Message(messageText,
attachments,
+ false,
List.of(),
Optional.empty(),
Optional.empty(),
try {
final var message = new Message(messageText,
attachments,
+ false,
List.of(),
Optional.empty(),
Optional.empty(),