- Message
Message
- useCookieJar(jar, username) ⇒
Promise.<TextNow>
Use a cookie jar to login
- usePuppeteer() ⇒
Promise.<TextNow>
Use a Puppeteer window to login [will be full/non-headless to allow user to login]
- init(fetch) ⇒
Promise.<Message>
Initalize message object, async to accommodate a possible media message download
- toString() ⇒
String
Returns contents of message, which is probably not what you want. So you really shouldn't use this in production.
- send(number, message)
Send a message
- fromNumber(number) ⇒
Promise.<Array.<Object>>
Get messages from number, does NOT emit message events
- toTNFormat(number) ⇒
String
- fromTNFormat(tnNumber) ⇒
PhoneNumber
- refreshUser() ⇒
Object
Refreshes this.user
Message
Kind: global class
- Message
- new Message(json)
- .raw :
Object
Param | Type | Description |
---|---|---|
json | Object |
Message JSON from TextNow |
Kind: instance property of Message
Use a cookie jar to login
Kind: global function
Returns: Promise.<TextNow>
- Authenticated and ready-to-go TextNow instance
Param | Type | Description |
---|---|---|
jar | CookieJar |
CookieJar to use |
username | String |
Username of authenticated user |
Use a Puppeteer window to login [will be full/non-headless to allow user to login]
Kind: global function
Returns: Promise.<TextNow>
- Authenticated and ready-to-go TextNow instance
init(fetch) ⇒ Promise.<Message>
Initalize message object, async to accommodate a possible media message download
Kind: global function
Param | Type | Description |
---|---|---|
fetch | function |
fetch function, authenticated with CookieJar to fetch a possible media message |
Returns contents of message, which is probably not what you want. So you really shouldn't use this in production.
Kind: global function
Returns: String
- Contents of message
Send a message
Kind: global function
Param | Type | Description |
---|---|---|
number | String |
Phone number, will be converted using libphonenumber-js |
message | String |
Message to send |
Get messages from number, does NOT emit message events
Kind: global function
Returns: Promise.<Array.<Object>>
- Array of messages
Param | Type | Description |
---|---|---|
number | PhoneNumber | String |
Phone number, will be converted using libphonenumber-js if it's a string |
Kind: global function
Returns: String
- Phone number in TextNow [E.164] format
Param | Type | Description |
---|---|---|
number | PhoneNumber | String |
Number in any format recognized by libphonenumber-js, or an instance of PhoneNumber |
Kind: global function
Param | Type | Description |
---|---|---|
tnNumber | String |
Number in TextNow format |
Refreshes this.user
Kind: global function
Returns: Object
- this.user