Skip to content

Commit

Permalink
Deprecate sendSMS()
Browse files Browse the repository at this point in the history
Replaced by `createText()`.
  • Loading branch information
alexwhitman committed Feb 12, 2022
1 parent 9b7bcda commit ac2fe7e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -7,6 +7,7 @@
- Callback functionality has been removed. Callbacks can still be used by using `util.callbackify()`.
- `request` has been replaced by `node-fetch`. Full API responses are returned by function calls.
- Add support for for text API.
- Deprecate `sendSMS()`, this is deprecated in the API and is replaced by `createText()`.

### 2.4.0

Expand Down
5 changes: 3 additions & 2 deletions lib/internal/ephemerals.js
@@ -1,5 +1,6 @@
import clone from 'clone';
import PushBullet from '../pushbullet.js';
import util from 'util';

/**
* Send an SMS.
Expand All @@ -10,14 +11,14 @@ import PushBullet from '../pushbullet.js';
* @param {Object} smsOptions SMS options.
* @returns {Promise}
*/
PushBullet.prototype.sendSMS = async function sendSMS(smsOptions) {
PushBullet.prototype.sendSMS = util.deprecate(async function sendSMS(smsOptions) {
const options = clone(smsOptions);

options.package_name = 'com.pushbullet.android';
options.type = 'messaging_extension_reply';

return this.sendEphemeral(options);
};
}, 'sendSMS() is deprecated, use createText() instead.');

/**
* Send clipboard content.
Expand Down

0 comments on commit ac2fe7e

Please sign in to comment.