import org.asamk.signal.commands.exceptions.IOErrorException;
import org.asamk.signal.commands.exceptions.UserErrorException;
import org.asamk.signal.manager.Manager;
import org.asamk.signal.commands.exceptions.IOErrorException;
import org.asamk.signal.commands.exceptions.UserErrorException;
import org.asamk.signal.manager.Manager;
subparser.addArgument("number").help("Contact number");
subparser.addArgument("-n", "--name").required(true).help("New contact name");
subparser.addArgument("-e", "--expiration")
.required(false)
.type(int.class)
.help("Set expiration time of messages (seconds)");
subparser.addArgument("number").help("Contact number");
subparser.addArgument("-n", "--name").required(true).help("New contact name");
subparser.addArgument("-e", "--expiration")
.required(false)
.type(int.class)
.help("Set expiration time of messages (seconds)");
var expiration = ns.getInt("expiration");
if (expiration != null) {
m.setExpirationTimer(number, expiration);
}
var expiration = ns.getInt("expiration");
if (expiration != null) {
m.setExpirationTimer(number, expiration);
}
} catch (InvalidNumberException e) {
throw new UserErrorException("Invalid contact number: " + e.getMessage());
} catch (IOException e) {
throw new IOErrorException("Update contact error: " + e.getMessage());
} catch (InvalidNumberException e) {
throw new UserErrorException("Invalid contact number: " + e.getMessage());
} catch (IOException e) {
throw new IOErrorException("Update contact error: " + e.getMessage());