Comparing version 3.0.2 to 3.1.0
@@ -51,2 +51,4 @@ // Generated by LiveScript 1.4.0 | ||
function(){ | ||
var text, ref$; | ||
text = ((ref$ = options.prefix) != null ? ref$ : '') + "" + bind$(util, 'format').apply(this, arguments) + ((ref$ = options.suffix) != null ? ref$ : ''); | ||
request.post({ | ||
@@ -53,0 +55,0 @@ url: "https://api.telegram.org/bot" + options.token + "/sendMessage", |
{ | ||
"name": "stopstop", | ||
"version": "3.0.2", | ||
"version": "3.1.0", | ||
"description": "simple telegram output passer", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -92,7 +92,9 @@ # stopstop | ||
You'll notice that `options`, an object, is completely different from the string `token` that stopstop's other form expects as a first parameter. That's how stopstop knows which version you want. As far as stopstop is concerned, providing an `options` object replaces the first two parameters of its other form. There isn't any difference beyond that. | ||
* `options` _object_. Make choices about what you want stopstop to do! | ||
- `token` _string_. Your bot's api token! Your messages will come from the bot this corresponds to. | ||
* `options` _object_. Make choices about what you want stopstop to do! Everything that doesn't say **required** is optional. | ||
- `token` **required** _string_. Your bot's api token! Your messages will come from the bot this corresponds to. | ||
- `params` _object_. This object is passed directly to Telegram's bot API as request parameters, so you probably wannya look at [their sendMessage reference](https://core.telegram.org/bots/api#sendmessage) for more details. | ||
+ `chat_id` _number_. This is where you specify who you want your bot to send messages to. | ||
+ `chat_id` **required** _number_. This is where you specify who you want your bot to send messages to. | ||
+ `text` _nothing_. While you _can_ set a text parameter and stopstop won't throw an error, there's no point in doing so because it'll get overwritten. | ||
- `prefix` _string_. If you set this to a string, it'll get added to the beginning of all of your messages. If you don't set it to anything, nothing will get added. | ||
- `suffix` _string_. If you set this to a string, it'll get added to the end of all of your messages. If you don't set it to anything, nothing will get added. | ||
* `data` _anything_. Just think of this part as the arguments you would pass to `console.log` and you'll be fine! | ||
@@ -116,2 +118,10 @@ * `...` _anything_. Just like `console.log`, you can actually pass multiple data arguments and they'll get strung together! | ||
```javascript | ||
stopit = stopstop('<token>', 123456789).now({ | ||
prefix: 'SUPER IMPORTANT ALERT:\n\n', | ||
suffix: '\n\nThis message was brought to you by stopstop.' | ||
}); | ||
stopit('I think I get it now!'); | ||
``` | ||
## Making a bot and finding your chat id | ||
@@ -118,0 +128,0 @@ Before you can start using stopstop, you will need a Telegram bot and the chat ids of the chat you wish to have your bot notify. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14524
85
169
3